Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rollback multiple commits (before Pushed to public) in Mercurial

I am aware that rollbacks can remove commits from the latest changeset in a local repository. However, is it possible to remove all the latest commits since the previous push without having to re-clone the share repository?

like image 811
Karan Avatar asked Feb 07 '11 18:02

Karan


2 Answers

You can use the hg strip command, part of the mq extension:

hg strip REV

This will remove that revision + all its descendants.

Before you try this, make a copy/clone of the repository to experiment in.

like image 52
Lasse V. Karlsen Avatar answered Oct 20 '22 00:10

Lasse V. Karlsen


You could make a new repo with hg clone:

hg clone -r last_good_changeset localrepo newlocalrepo
like image 20
VonC Avatar answered Oct 19 '22 23:10

VonC