最近,我们项目的一个贡献者提交了一次破坏系统的更改。我正在尝试回滚到最新的可用版本:
我使用git log查找该提交:
commit 45359d69e7983946b233d9010f205be19ce8ebfe
Author:Tom
Date: Mon Apr 14 14:59:50 2014 +0100
Tweaks the interface to make it more clean
I then do:
git checkout 45359d69e7983946b233d9010f205be19ce8ebfe
接下来是:
git add -A && git commit -am "revert"
我最终尝试:
git push
它将返回:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'path'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
(在路径处,我只删除了服务器的URL)
有什么想法吗?