Casebash
Casebash

Reputation: 118792

Reverting a merge in Mercurial

I did a merge, but then I stuffed it up, so I decided to revert back. I have tried to revert to one of the revisions I merged several times, but this doesn't work. It doesn't throw any errors, it is just that my current repository state is still shown as having two heads. I also tried deleting all of the backup files that reversion automatically creates. How can I restore my repository to a clean state on one of the heads?

Upvotes: 3

Views: 386

Answers (1)

Geoffrey Zheng
Geoffrey Zheng

Reputation: 6640

Try hg update -C to one of the heads, or any revision.

To avoid the situation, instead of reverting you can just commit the unwanted merge, then strip it later.

Upvotes: 3

Related Questions