取消“git推動”這是我在我的應該是穩定的分支.。% git rebase masterFirst, 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 pushFetching 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-dateUpdating remote server info這是一個錯誤,我后來意識到。我想撤銷整個過程,并將alpha-0.3.0分支恢復到原來的狀態。我該怎么辦?
3 回答

翻過高山走不出你
TA貢獻1875條經驗 獲得超3個贊
git push -f origin last_known_good_commit:branch_name
git push -f origin cc4b63bebb6:alpha-0.3.0
receive.denyNonFastForwards
[remote rejected]
.
git push origin :alpha-0.3.0 git push origin cc4b63bebb6:refs/heads/alpha-0.3.0
receive.denyDeletes
git update-ref refs/heads/alpha-0.3.0 cc4b63bebb6 83c9191dea8

白豬掌柜的
TA貢獻1893條經驗 獲得超10個贊
git checkout alpha-0.3.0 git reset --hard cc4b63bebb6 git push origin +alpha-0.3.0

泛舟湖上清波郎朗
TA貢獻1818條經驗 獲得超3個贊
git revert
prompt> git revert 35f6af6f77f116ef922e3d75bc80a4a466f92650 [master 71738a9] Revert "Issue #482 - Fixed bug." 4 files changed, 30 insertions(+), 42 deletions(-) prompt> git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) prompt>
- 3 回答
- 0 關注
- 614 瀏覽
添加回答
舉報
0/150
提交
取消