git can't merge 的处理 代码冲突问题的解决

***取回已经提交的代码 git reset HEAD^

git can't merge 的处理
1.git status 确保status 为空,可以先提交
2.git reset HEAD^    取回已经提交的代码
3.git status 查看 此时提交代码已经都已经拿回
4.git stash -u 缓存所有代码
5.git status  此时应该为空
6.git log
7.git reset --hard HEAD^ 回退版本
8.git pull --rebase origin master 更新代码 与fetch 一样
9.git stash apply 合并自己stash的代码
10. git mergetool 解决冲突
11.git gui 提交代码 --commit
12.git push origin HEAD:refs/for/master

原文地址:https://www.cnblogs.com/jintaostudy/p/7058203.html