I use this when I want to discard changes to a directory:
$ git checkout path/to/dir/
But now I need to delete files that were created (not changed) in this directory and the check didn't work. What can I do?
git clean -f or git clean -f -d , if you also want to delete the directory. Source Also check out the official documentation
git clean -f
git clean -f -d