Search code examples
version-controlmercurialmergedvcsundo

How to abort a merge in mercurial?


I goofed up a merge. I'd like to revert then try again.
Is there a way to revert a merge before it is committed?

hg revert doesn't do what I'd like, it only reverts the text of the files. Mercurial aborts my second attempt at merging and complains original merge is still uncommitted.

Is there a way to undo a merge after an hg merge command but before it's committed?


Solution

  • hg update -C <one of the two merge changesets>