How to delete all changes from working directory including new untracked files. I know that git checkout -f
does that, but it doesn't delete new untracked files created since last commit.
Does anybody have an idea how to do that?
How to delete all changes from working directory including new untracked files. I know that git checkout -f
does that, but it doesn't delete new untracked files created since last commit.
Does anybody have an idea how to do that?
Have a look at the git clean
command.
git-clean - Remove untracked files from the working tree
Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.
Normally, only files unknown to git are removed, but if the -x option is specified, ignored files are also removed. This can, for example, be useful to remove all build products.