Mercurial:回滚"hg commit --amend". [英] Mercurial: roll back an "hg commit --amend".

查看:114
本文介绍了Mercurial:回滚"hg commit --amend".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心做了一个"hg commit --amend"而不是一个commit.如何在修订之前回滚提交?

I accidentally did a "hg commit --amend" instead of just a commit. How can I roll back the commit to before the amend?

推荐答案

注意::现在不赞成使用此答案.请参阅来自@Sorina Sandu的答案.

NOTE: This answer is now deprecated. See the answer from @Sorina Sandu instead.

请参见 hg help commit ,其中表示:

See hg help commit, where it says:

-amend标志可用于修改工作的父项 具有新提交的目录,其中包含父目录中的更改 除了目前由汞状态"报告的那些(如果有). 旧的提交存储在".hg/strip-backup"中的备份包中(请参阅 "hg help bundle"和"hg help unbundle"以了解如何还原它.)

The --amend flag can be used to amend the parent of the working directory with a new commit that contains the changes in the parent in addition to those currently reported by "hg status", if there are any. The old commit is stored in a backup bundle in ".hg/strip-backup" (see "hg help bundle" and "hg help unbundle" on how to restore it).

这篇关于Mercurial:回滚"hg commit --amend".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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