Git · History and recovery
git reset --hard
Moves the branch and discards working-tree changes. This can destroy uncommitted work.
Syntax
git reset --hard <ref>Example
Example
git reset --hard HEAD~1
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.