Git: Undo All Working Tree Changes, Including Untracked Files And Directories

Use the following commands if you’d like to remove all recent changes made since the last commit.

This command resets the index and working tree. Any changes made to tracked files in the working tree since the last commit are discarded.

git reset --hard

This will recursively remove all files and directories that are not under version control (untracked).

git clean -f -d

Add the -x flag if you want to remove ignored files as well.

git clean -f -d -x

I'm a Long Island, NY based Web and App Designer.