Git: How to overwrite local change?

mlz*_*boy 9 git restore

I use git clone from github and I deleted some files & modified some files. Now I want to keep my local code & restore to the original form. Is there a command to achieve this?

ser*_*yPS 12

如果你想先保存更改,你可以先提交它们然后检查你的代码到之前的提交:( git checkout HEAD^一次提交) git checkout GEAD~2(2提交回来)

或者,如果您不再需要更改,请运行 git reset --hard HEAD


Nic*_*ore 8

git checkout <name of file>

如果要查看整个存储库,则从根目录使用

git checkout .