Throw a bunch of commits in Mercurial

I committed several times with mercury and pushed my commits. Nobody touched them. How can I “throw away” these commits in order to restore the local and remote repos (both the repo and the working directory) with the specified commit? Thank.

+5
source share
2 answers

The fastest way is to simply clone your local repo to the latest “good” version and discard the old one.

This only works if these changes are the last n in history.

You can copy the section of the [paths]old .hg / hgrc repository file to the new one if you want to continue the transition to the third "main" repo.

+3
source

$hg revert, .

$hg help revert , , .

:

--all

--date

--rev

--rev, , , , .

, , , , .

+1

All Articles