user2969259
user2969259

Reputation: 13

how could I go back to a specific revision in mecurial?

I have 4 changesets and I want to return to Revision 2 and cancel revisions 3 and 4. is this possible? and what is the command to type?

Upvotes: 0

Views: 226

Answers (1)

Bruno Gelb
Bruno Gelb

Reputation: 5652

hg update [-r REV] changes your working copy parent revision and also changes the file content to match this new parent revision. This means that new commits will carry on from the revision you update to.

and what exactly do you mean by 'cancel'? exclude them from existence? You can do that by using strip command:

hg strip [-r REV]

which removes the changeset and all its descendants from the repository. It will be as if the changes never existed. this command is part of the MqExtension which you need to enable first.

Upvotes: 1

Related Questions