可能重复:
如何从git工作副本中删除未跟踪的文件?
是否有可能告诉git删除未跟踪文件?主要是类似于重置的东西?
例:
git checkout -- index.php <-- revert my file
git checkout -- master <-- this would revert the entire repo back to the last commit on master, removing (deleting) any and all untracked files as well as reverting committed ones.
Run Code Online (Sandbox Code Playgroud)
我知道这对shell来说是微不足道的,但我想知道这是否可以在Git中完成?