Discard uncommitted changes

Isabelle Viktoria Maciohsek · 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
# Discards all unstaged changes

Recommended snippets