我觉得这个问题已经被问过很多次了,但是解决方案通常是“我删除了目录,然后用一个新的签出重新做了我的工作。”我进行了提交和推送,但发现在提交消息中引用了错误的票证号码。因此,我期待着一个快速的 解决方案,并最终在终端输入以下内容:
$ git reset --soft HEAD^
$ git commit -m "... correct message ..."
唯一的问题是我收到了以下错误消息:
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
我正在使用 git-flow 模型,并在开发分支上工作。我怎样才能把事情合并回来,让 git 再次快乐起来呢?