git 撤销本地修改

git checkout file

例如:git checkout app/views/carts/_index_m.html.erb

可以先用 git status 查看差异

然后 git checkout file【显示的存在差异的文件名】

原文地址:https://www.cnblogs.com/lpt1229/p/5979743.html