sh 将意外提交从主分支移动到新分支

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将意外提交从主分支移动到新分支相关的知识,希望对你有一定的参考价值。

# save everything to a new branch
git branch newbranch

# Reset master to before the new commits were added
# (Warning: You *will* lose uncommitted work)
git reset --hard HEAD~3 # Go back 3 commits.

# Checkout your new branch to see the commits
git checkout newbranch

以上是关于sh 将意外提交从主分支移动到新分支的主要内容,如果未能解决你的问题,请参考以下文章