git reset . will not remove the untracked files. It can affect only those files which have been git add -ed. Since untracked files are non- git add -ded files, they will remain untouched. ... This will show a list of files and directories that will be removed, if the command is run without the -n option.
Does git reset hard delete files?
Let's recap!
git reset --hard can delete all of your unstaged and staged files! You can backtrack by a specific number of commits.
How do I get rid of untracked files in git?
How to remove local untracked files from the current Git branch
- To remove directories, run git clean -f -d or git clean -fd.
- To remove ignored files, run git clean -f -X or git clean -fX.
- To remove ignored and non-ignored files, run git clean -f -x or git clean -fx.