I want to completely delete a Mercurial commit as if it was never entered in the repository and move back to my prior commit.
Is this possible?
You cannot. You can close the branch to hide it from the list of active branches, but you cannot completely delete it. This happens because in mercurial and in git the "branch" term means different things. In mercurial - it is a set of changesets.
Jonathan: Removing it is quite proper. We try to keep simple things simple in Mercurial: hg init creates . hg for you, and rm -r . hg will undo that.
If it was your last commit and you haven't pushed it anywhere, you can do that with rollback
. Otherwise, no. Not really. Time to change your passwords.
Edit: It has been pointed out that you can clone from an older revision and merge in the changes you want to keep. That's also true, unless you have pushed it to a repo you don't control. Once you push, your data is very likely to be very hard to get back.
You can try to remove mq info about your commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With