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

# Examples
git reset --hard HEAD
# Discards all unstaged changes

More like this