Friday, August 26, 2016

Revert strip in Hg Mercurial

So you are using Mercurial version control system and Tortoise Hg as its windows GUI tool. And after you made changes you accidentally clicked "Modify History -> Strip",



So strip command  removed all your changes! Don't worry, there is a way to recover from this action and bring those changes back. Follow these steps:

1. For every strip action, the changes are backed up automatically to the "REPO/.hg/strip-backup". Open the backup folder and copy the latest modified file name.



2. Open Hg terminal by clicking Repository->Terminal.



3. Run this command: hg pull $(hg root)/.hg/strip-backup/$(backup file name)


    Voila! Here comes the changes back:








0 comments:

Post a Comment