How to remove local (untracked) files from the current Git working tree? Posted on 2017-09-262019-12-05 答案是 git clean -fdx To remove untracked files / directories do: git clean -fdx -f – force -d – directories too -x – remove ignored files too ( don’t use this if you don’t want to remove ignored files)