For those who need something less far-reaching than Scott Schafer’s answer,
git clean -f
will likely work. I highly suggest running
git clean --dry-run
first. That command will output a list of files that Git will remove if you run git clean -f
, and might save you the pain of inadvertently removing something you didn’t want to.
See this Stack Oveflow answer or the docs for more information on git clean
.