Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to undo `hg pull`?

Tags:

mercurial

I accidentally did a hg pull and it created a branch in my local repo.

What is the simplest to undo that and get my local repo back to previous state?

like image 429
Sylvain Avatar asked Sep 02 '10 18:09

Sylvain


People also ask

How do you undo a hg pull?

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.

How do you revert changes in Heartgold?

Revert changes already committed To backout a specific changeset use hg backout -r CHANGESET . This will prompt you directly with a request for the commit message to use in the backout. To revert a file to a specific changeset, use hg revert -r CHANGESET FILENAME . This will revert the file without committing it.

How do you revert push changes in mercurial?

You need to login to the server and use the hg strip command. If you cannot login to the server, you are out of luck; you can hg backout then push again, but this will leave the bad commits on the server along with the commit that undoes them. Show activity on this post. hg revert -r .


1 Answers

hg rollback but beware the caveats:

This command should be used with care. 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.
...

like image 104
msw Avatar answered Oct 11 '22 15:10

msw