这就是我在我所谓的稳定分支上所做的事情......
% git rebase master
First, rewinding head to replay your work on top of it...
Fast-forwarded alpha-0.3.0 to master.
% git status
# On branch alpha-0.3.0
# Your branch is ahead of 'origin/alpha-0.3.0' by 53 commits.
#
nothing to commit (working directory clean)
% git push
Fetching remote heads...
  refs/
  refs/heads/
  refs/tags/
  refs/remotes/
'refs/heads/master': up-to-date
updating 'refs/heads/alpha-0.3.0'
  from cc4b63bebb6e6dd04407f8788938244b78c50285
  to   83c9191dea88d146400853af5eb7555f252001b0
    done
'refs/heads/unstable': up-to-date
Updating remote server info
这是我后来意识到的一个错误.我想撤消整个过程,并将alpha-0.3.0分支恢复到原来的状态.
我该怎么办?
作为一个初级git用户,我被一个艰难的合并所淹没,一定做错了.我最终在我的源文件中提交了一堆乱七八糟的垃圾解决方案.提交显示了许多看起来像<<<<<<< HEAD和的行的添加>>>>>>> a7b4de79431c2e73d28621c72c8d14820df1a24b.提交已经被推送到远程源,所以我不幸只能修改提交.
我想将远程存储库回滚到最后一次良好的提交,4a3ba7b0e56cf0be80274c1f879029220a889bde并且(如果可能的话)销毁错误的提交d004651972cbc35f70ee5a2145b6e03169c77279.
我试过了:
git checkout 4a3ba7
git push -f
得到了: fatal: You are not currently on a branch.