It looks like you are looking for a backout
. Cm:
hg help backout
I don’t think it can cancel multiple commits at a time, so you need to cancel them yourself:
hg backout D hg backout C hg backout B
This will create three commits on top of D that are facing D, and C and B. If you want to combine these commits into one set of changes, you can add them using rebase --collapse
or one of several other extensions (for example, histedit
or mq
or collapse
).
If you do not want to undo individual changes, but all this at a time, you can do the following:
hg update A hg debugsetparents D hg commit -m "revert BD"
Its ugly, but it works. However, this does not write renames in reverse order. Honestly, I would not recommend doing this if you need to drop it so much that the individual retraction commands are too complex to print, makes me wonder if what you should really do in this particular case.
Alternatively, you could do what Jim and Raphael suggested and decide that B, C, and D are on a branch and upgrade to A and continue to do there (turning off the story at this point). This may be more appropriate.
source share