Mercurial-恢复到旧版本并从那里继续 [英] Mercurial — revert back to old version and continue from there
问题描述
我在本地使用Mercurial进行项目(这是唯一没有从其他任何地方推入/拉出的回购协议).
到目前为止,它具有线性历史记录.但是,我现在意识到的当前工作是一种糟糕的方法,我想在开始之前先回到该版本,并以另一种方式实现它.
我对Mercurial中的branch
/revert
/update -C
命令有点困惑.基本上,我想恢复到38版(当前为45版),并让我的下一个提交以38作为父级并从那里继续进行.我不在乎39-45修订版是否会永远丢失或最终落入自己的死胡同.
我需要哪个命令/一组命令?
hg update [-r REV]
如果稍后提交,则将有效地创建一个新分支.然后,您可以只继续在该分支上工作,或者最终将现有分支合并到该分支中.
I'm using Mercurial locally for a project (it's the only repo there's no pushing/pulling to/from anywhere else).
To date it's got a linear history. However, the current thing I'm working on I've now realized is a terrible approach and I want to go back to the version before I started it and implement it a different way.
I'm a bit confused with the branch
/ revert
/ update -C
commands in Mercurial. Basically I want to revert to version 38 (currently on 45) and have my next commits have 38 as a parent and carry on from there. I don't care if revisions 39-45 are lost for ever or end up in a dead-end branch of their own.
Which command / set of commands do I need?
hg update [-r REV]
If later you commit, you will effectively create a new branch. Then you might continue working only on this branch or eventually merge the existing one into it.
这篇关于Mercurial-恢复到旧版本并从那里继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!