April 07, 2014
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