您如何“回滚"?对Mercurial的最后提交? [英] How do you "rollback" last commit on Mercurial?

查看:91
本文介绍了您如何“回滚"?对Mercurial的最后提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Mercurial存储库,仅在本地使用...仅供我个人使用(因此,我不会在任何地方推送").

I have a Mercurial repository that I use in local only... It's for my personal usage (so I don't "push" anywhere).

我提交了3个文件,但是之后我明白我应该提交4个文件...

I made a commit with 3 files, but after that I understood that I should do commit 4 files...

是否可以回滚"我的最后(最新的,只有一个)提交,并使用正确的文件重新提交"?

Is there a way to "rollback" my last (latest, only one) commit, and "recommit" it with the correct files?

(我不知道为什么,但是我的"修改当前版本"选项未激活,因此我无法使用它...)

(I don't know why, but my "Amend current revision" option is not active, so I can't use it...)

推荐答案

您只需要以下命令:

hg rollback

请参阅: http://hgbook.red-bean. com/read/finding-and-fixing-mistakes.html .

(从技术上讲,从2013年8月的2.7版开始不推荐使用,但我还没有看到执行完全相同的操作的替代方法.)

(Technically, this is deprecated as of version 2.7, August 2013, but I've yet to see an alternative that does exactly the same thing.)

这篇关于您如何“回滚"?对Mercurial的最后提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆