Removal of untracked files from the working tree
$git clean -n
$git clean -f
while working with -f be cautious that may delete files.
for removing directories,
$ git clean -f -d
$git clean -fd.
For removing ignored files,
$git clean -f -X
$git clean -fX
for removing ignored and non-ignored files,
run git clean -f -x
git clean -fx
here x is case sensitive in commands.
If clean.requireForce is set to "true" (the default) in your configuration, you need to specify -f otherwise nothing will happen.
For more commands like this please go through the following tutorial that helps you to understand better