将远程分支还原到先前的提交

问题描述

由于错误,我很少进行错误的提交。现在,我想将我的develop分支还原为垂直的提交ID。

我尝试过

$git reset --hard 9f3df1996f435907575acafe922b22b88e6f10c4
HEAD is Now at 9f3df19 Merge pull request #1 from txxxx/feature-1

这已使该提交的旧存储库转入我的本地存储库。但是当我尝试推动此操作时,它给了我一个错误

$git push origin develop

To https://github.com/txxxxx/XXxxxx.git
 ! [rejected]        master -> master (non-fast-forward)
error: Failed to push some refs to 'https://github.com/txxxxx/XXxxxx.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我不确定现在如何将这些本地代码(来自上一次提交)推入我的develop分支。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)