微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决将远程分支还原到先前的提交

由于错误,我很少进行错误的提交。现在,我想将我的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 举报,一经查实,本站将立刻删除。