【发布时间】:2010-11-19 05:20:29
【问题描述】:
这是我在 supposed-to-be-stable 分支上所做的...
% 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 分支恢复到原来的样子。
我该怎么办?
【问题讨论】:
-
这个stackoverflow帖子也许? stackoverflow.com/questions/134882/undoing-a-git-rebase
-
实际情况不一样,撤消 rebase 是本地存储库方案,撤消 git push 涉及远程存储库,根据您的访问权限可能会更加棘手。
-
Steen - 你是对的 - 我想我可能应该有。我认为所有从中提取的受祝福的存储库更像是一项管理任务,因此属于这里,一般客户端 git 是一个 stackoverflow 问题。
-
快速澄清-我猜如果您通过 partial 哈希值引用 git 提交,git 会假设您正在谈论哈希以该哈希开头的提交字符串?