How can I undo every change made to my directory after the last commit, including deleting added files, resetting modified files, and adding back deleted files?
Step 1: Reset the changes with the help of following command:
$ git reset HEAD --hard
Step 2: Clean out everything untracked. In case you want to keep files that are not tracked due to .gitignore, be careful with this command.
$ git clean -fd