git reset --hard

20 August 2026

This is what you need most of the time when you want to undo: git reset --hard and then git push --force-with-lease

Git
git reset --hard 12345678
git push --force-with-lease