Billy ONeal
Billy ONeal

Reputation: 106549

How does one undo the contents of a changeset or changesets in Mercurial?

I have some changesets from a few months ago where I converted from one unit test framework to another. (Don't ask) I decided I don't like the new framework, and would like to revert to using the old one.

I don't want to actually remove the changesets in question from my repository -- I just want a changeset which undoes what a previous changset or changesets did.

Back when I used svn, there was a TortoiseSVN command to do this which would "reverse merge" a set of commits into a working copy.

Does Mercurial have any such capability out of the box or am I going to have a fun night with Beyond Compare?

Upvotes: 2

Views: 93

Answers (1)

zck
zck

Reputation: 2762

You're looking for hg backout. From the mercurial documentation:

Backout works by applying a changeset that's the opposite of the changeset to be backed out. That new changeset is committed to the repository, and eventually merged.

You want to call it with a specific revision. For example, to backout revision with revision number 3, run hg backout -r 3

Upvotes: 2

Related Questions