使用Git將最新提交移至新分支 - Move the most recent commit(s) to a new branch with Git

問題:

I'd like to move the last several commits I've committed to master to a new branch and take master back to before those commits were made. 我想將我已承諾掌握的最後幾個提交移動到新的分支,並在作出這些提交以前將master從新帶回去。 Unfortunately, my Git-fu is not strong enough yet, any help? 不幸的是,個人Git-fu還不夠堅固,有什麼幫助嗎? this

Ie How can I go from this 即我該如何去 spa

master A - B - C - D - E

to this? 對此嗎? .net

newbranch     C - D - E
             /
master A - B

解決方案:

參考一: https://stackoom.com/question/6pf9/使用Git將最新提交移至新分支
參考二: https://oldbug.net/q/6pf9/Move-the-most-recent-commit-s-to-a-new-branch-with-Git
相關文章
相關標籤/搜索