I am using TortoiseHg for version control. I pushed to the remote repository after commiting to the local. How do I undo to a particular commit point?
There were three distinct pushes, and I want to revert to the first push. I read about the hg rollback and hg undo commands, but I am not sure how to use them to accomplish this.
There is only one level of rollback, and there is no way to undo a rollback. It will also restore the dirstate at the time of the last transaction, losing any dirstate changes since that time. This command does not alter the working directory.
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.
In the TortoiseHg client's Commit dialog, right-click the needed file and then click Revert.
Because you have pushed to another repository, you have no way of knowing where your changes have propagated to. If you hadn't pushed, you could do undo, but undo only does the last transaction anyway.
The other option to truly modify history would be the strip command, but again, because you've pushed, this is not an option. If you stripped your local, you'd still get the changesets back the next time you pulled.
If you have access to the central, you could strip it, but if someone else has already pulled your changes, then they would re-appear in the central again the next time they push.
Your only safe option at this point in time is the backout command. This basically creates a new changeset at tip that reverses the changesets you've accidentally put in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With