Reputation: 60084
I want a Mercurial analogue of git reset HEAD~2
(completely abandon the last 2 commits -- but keep the local file changes).
In my specific case, I wanted to abandon all changes since the last hg pull
, so what I did was:
hg clone $(hg paths default) tmp
rm -rf .hg
mv tmp/.hg .
rm -rf tmp
Is there an "official" way to do this?
The answers to Mercurial — revert back to old version and continue from there keep the bad commits. I want to abandon them - but not the local changes.
Upvotes: 1
Views: 72
Reputation: 2797
To delete revisions from the repository, keeping the files:
hg strip --keep firstBadRevisionToDelete
Upvotes: 3