Git: How to fully clean a working directory

Just a note to self on how to fully clean a git working directory. Have some tricky projects where I’m currently located, and sometimes things gets 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