Reputation: 577
Using mercurial
, I regularly run into the following problem which I am not able to securely resolve:
hg commit -m "my changes"
hg checkout -r -15
The problem is that in between (2) and (3), I forgot to first commit my uncommitted changes. mercurial
then tries to merge my local changes into the old commit.
How do I undo the checkout in (3) and get back to stage (2)?
This is, I would like to again have the last commit being the commit in (1) and would still like to have the uncommitted local changes in (2).
Upvotes: 0
Views: 243
Reputation: 97260
How do I
Short answer
Nohow
Longer answer
You can't restore the exact state of working directory anyway. But you can:
hg up
with dirty working directory (with uncommitted changes): redefine update in aliases as hg up -c
Upvotes: 1