【问题标题】:How to Undo git commit --amend [duplicate]如何撤消 git commit --amend [重复]
【发布时间】:2017-01-08 01:13:20
【问题描述】:

我不小心在树上的最后一次提交上做了git commit --amend(这不是我写的),我想撤消这个commit检索我的更改回到工作目录。

我熟悉 --commit amend 是“重写历史”Git 命令的一部分这一事实,但我希望通过作者姓名或任何其他名称有解决方法。

【问题讨论】:

    标签: git git-commit git-rewrite-history


    【解决方案1】:

    是的,有一种方法可以在修改之前恢复您的状态。 转到工作副本并运行git reflog,在修改之前找到提交的哈希并对其进行 git 重置。你完成了;)

    重复:How to undo "git commit --amend" done instead of "git commit"

    【讨论】:

      猜你喜欢
      • 2017-05-11
      • 2010-11-30
      • 2016-10-09
      • 2013-03-06
      • 1970-01-01
      • 2017-04-15
      • 2022-01-01
      • 2020-02-06
      相关资源
      最近更新 更多