Mercurial - 恢复到旧版本并从那里继续 [英] Mercurial — revert back to old version and continue from there
问题描述
我在本地为一个项目使用 Mercurial(这是唯一一个没有推/拉到/从其他任何地方拉动的存储库).
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.
我对 Mercurial 中的 branch
/revert
/update -C
命令有点困惑.基本上我想恢复到 38 版(目前是 45 版)并让我的下一次提交以 38 为父级并从那里继续.我不在乎修订版 39-45 是否会永远丢失或最终进入他们自己的死胡同.
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屋!