团队其他成员修改了某文件并已提交入库,你在pull之前修改了本地该文件,等你修改完代码再pull时,这时会报错如下错误:

error: Your local changes to the following files would be overwritten by merge

保留修改

git stash #封存修改
git pull origin master 
git stash pop #把修改还原

废弃修改

git reset --hard 
git pull origin master