摘要: 一,未使用 git add 缓存代码时。 可以使用 git checkout -- filepathname (比如: git checkout -- readme.md ,不要忘记中间的 “--”两边都有空格 ,不写就成了检出分支了!!)。放弃所以的文件修改可以使用 git checkout . 阅读全文