git reset command rewrites project history — for example, to undo the last commit. Because it rewrites history, be careful when resetting commits that are already public (pushed).
bash
# Resets the staging area and working directory to the last commit
# --hard flag is destructive and will delete your uncommitted changes!
git reset --hard HEAD
# Moves HEAD back one commit, keeping the changes in the working directory
git reset HEAD~1You should see
(A powerful command that can rewrite commit history — use it carefully)