Reset

Chester Wyke August 26, 2022 Updated: April 15, 2025 #git

Reset to current head and discard all including stash

git reset --hard

Undo accidental reset

Source: https://stackoverflow.com/questions/5788037/recover-from-losing-uncommitted-changes-by-git-reset-hard

git reflog show

then use the HEAD@{?} and replace the question mark like

git reset HEAD@{1}