Rollback multiple commits (before Pushed to public) in Mercurial

对着背影说爱祢 提交于 2019-12-03 11:03:06

You could make a new repo with hg clone:

hg clone -r last_good_changeset localrepo newlocalrepo

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.

If you are using mercurial eclipse, you can rollback once, then shelve those changes, then export the multiple sequential commits as patches, strip those commits, then import those patches in the same order, so in case you had conflicting patches, they overwrite each other in the desired way.

Finally you can unshelve your first rollback. This achieves the same effect as if you were rolling back more than once.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!