Search code examples
mercurialtortoisehg

Reverting several commits and rolling back


The image shows that I was working after revision 323 when I realized that revisions 323 and 322 were completely garbage.

So, I updated to revision 321 and I now realize that this is perfect and I would like to start fresh from here.

Without using strip, is there a clean way of destroying revisions 322 and 323 and then working and building on top of revision 321?

enter image description here


Solution

  • Assuming that you already have pushed these changes, (which is why you don't want to use strip)

    Option 1

    Just commit on top of 321, after you have done that, update to 323 and close the branch. Then update back to where you were and keep working.

    Option 2

    use backout on 323, then 322, then continue committing.

    Otherwise

    If you haven't pushed, and there is some other reason you don't want to use strip, you could just change the phase of 322 + 323 to secret, and continue working off 321. That way they won't ever be pushed, and so never seen by anyone else.