Mercurial 丢失工作
我进行了一些更改(称之为修订版 B)。然后我hg up A
返回到早期版本以修复一些错误。我忘记了我已经完成了这次更新,我意识到我已经将最后的更改提交到了错误的分支。所以我hg rollback
来摆脱那个提交(B)。它在这部分做得很好,但现在我坐在修订版 A 上,使用旧代码,我的最后一次提交消失了,并且 hg st
说 A 上的所有内容都是最新的。
我想我丢失了所有内容进入提交 B?有什么办法可以拿回来吗?
编辑:我没有将其推送到任何地方,这一切都发生在本地
I committed some changes (call it revision B). Then I did hg up A
back to an earlier version to fix some bug. Forgetting I had done this update, I realized that I had committed my last changes to the wrong branch. So I hg rollback
to get rid of that commit (B). It did that part well, but now I am sitting at revision A with the old code, my last commit gone, and hg st
says everything is up to date at A.
I guess I lost everything that went into commit B? Is there any way to get it back?
Edit: I did not push this anywhere, it all happened locally
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的更改会丢失 -
回滚
完全消除了提交 (参考)(其他参考)。尝试访问以前的变更集时,最好执行revert
,因为这不会删除任何后续变更集 - 它只是将文件的当前状态更改为看起来像在您要还原的变更集中所做的那样到。因此,如果您提交修订版 B,然后恢复到修订版 A,您的文件将看起来像修订版 A 中的那样,但您所做的任何更改都将放入下一个修订版 C 中,而修订版 B 将保留在您的存储库中。Your changes are lost -
rollback
completely eliminates the commit (ref)(other ref). It's preferable to dorevert
when attempting to access previous changesets, since that doesn't delete any subsquent changesets - it simply changes the current state of your files to look like they did at the changeset you're reverting to. So if you commit revision B and then revert to revision A, your files will look like they did at revision A, but any changes you make will be put into your next revision C, and revision B will remain in your repo.