Dogbert Dogbert - 1 year ago 83
Git Question

Reset all changes after last commit in git

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?

Answer Source

First reset the changes

git reset HEAD --hard

then clean out everything untracked

git clean -fd