Git
New Branch
git switch -c $branch_name
Undo Last Commit to Staged
Undo Last Commit to Unstaged
Reset to Remote
git fetch origin
git reset --hard origin/main
Undo Local Changes
index: backtrack
git reflog
# Observe the step you want to go back (e.g: HEAD@{3} or <SHA>)
git reset --hard 'HEAD@{1}'