Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Throw away a bunch of commits in Mercurial

Tags:

mercurial

I comitted few times with mercurial and pushed my commits. Nobody else pulled them. How can I "throw away" these commits to restore my local and remote repo (both repo and working dir) to a specified commit? Thank you.

like image 614
Dziamid Avatar asked Oct 14 '22 03:10

Dziamid


1 Answers

The quickest way is to just clone your local repo to the last 'good' revision, and discard the old one.

This only works if those revisions are the last n in the history.

You can copy the [paths] section of the old repo's .hg/hgrc file to the new one if you want to continue pushing to a third 'master' repo.

like image 119
John Weldon Avatar answered Oct 18 '22 09:10

John Weldon