0

While developing one web application, I made one tiny change in one commit, and then proceeded further. Today My repo has moved on quite far down the line. I want to the undo the changes made in that particular commit, while keeping the changes made in the successive commits.

How do I do this in Mercurial?

Example: Suppose in commit 96, I changed a boolean variable which was true to false.

Today my repository is at Rev 678. I want to undo only those changes made in commit 96.

How do I do this?

Devdatta Tengshe
  • 4,015
  • 10
  • 46
  • 59
  • As @LazyBadger mentioned [backout](http://mercurial.selenic.com/wiki/Backout) is what you are looking for. – Edward Jun 19 '14 at 17:50

1 Answers1

2
  • Delete changeset with hg strip|hg histedit (-1 changeset in history)

or

  • Backout changeset with hg backout (+1 changeset in history, which undo changes from wrong changeset)
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • 2
    Backout is the better answer. If anyone else is using the repository, strip and histedit won't work, you'll get the changeset back the next time you pull (unless you're using changeset evolution, but you're not). Stick with `hg backout` – Ry4an Brase Jun 19 '14 at 18:32