重置到初始状态,放弃修改 git reset --hard HEAD git checkout master git pull 覆盖本地修改 git reset --hard git pull 参考: 阮一峰 Git 教程