Files
30-seconds-of-code/snippets/discard-uncommitted.md
Isabelle Viktoria Maciohsek c191f90c77 Add discard snippets
2021-04-06 11:11:08 +03:00

345 B

title, tags
title tags
Discard uncommitted changes branch,intermediate

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