Git: How to fully clean a working directory

Published:

Just a note to self on how to fully clean a git working directory.

I have some tricky projects where I'm currently located, and sometimes things get messed up and IntelliJ doesn't know what to do with them anymore...

The following will clear everything out, and allow for a clean re-import:

git clean -f -x -d
-f
Force
-x
Also remove ignored files
-d
Also remove directories