1. 提交时,别人也有提交,导致冲突
You have divergent branches and need to specify how to reconcile them.

可以回退到合并前的版本
- 查看最近3次提交的历史版本

- 根据历史版本记录,选择
commit
地址,回退到自己合并之前的版本
再pull
yaml
git pull
2. 还原当前文件的改动
yaml
git checkout -- <filename>
此命令会使用 HEAD 中的最新内容替换掉你的工作目录中的文件。已添加到缓存区的改动,以及新文件,都不受影响。
3. 还原服务器版本
如你想要丢弃你所有的本地改动与提交,可以到服务器上获取最新的版本并将你本地主分支指向到它:
yaml
git fetch origin
git reset --hard origin/master