Files
30-seconds-of-code/git/s/discard-uncommitted.md
Angelos Chalaris 5c913d20bd Reorganize snippets
2023-05-03 21:19:02 +03:00

422 B

title, type, language, tags, cover, dateModified
title type language tags cover dateModified
Discard uncommitted changes snippet git
branch
arrays 2021-04-13T21:10:59+03:00

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