Start of main content
Discard uncommitted changes
Git, Branch · Apr 13, 2021

Discards all uncommitted changes to the current branch.
- Use
git reset --hard HEAD
to reset the local directory to match the latest commit and discard all unstaged changes.
git reset --hard HEAD
git reset --hard HEAD
More like this

Discards all untracked changes to the current branch.
Git, Branch · Apr 13, 2021

Did you make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git.
Git, Branch · May 26, 2023

Prints the current status of the working tree.
Git, Branch · Apr 13, 2021