【Git】(五)切换分支
1、切换分支
git checkout newBranch
2、如果需要保留本地修改
git status
git add .
git commit --amend
git checkout newBranch
3、强制切换分支
放弃本地修改,强制切换。
git checkout -f newBranch
git checkout newBranch
git status
git add .
git commit --amend
git checkout newBranch
放弃本地修改,强制切换。
git checkout -f newBranch