How to undo the last Git commit (reset, revert, amend, restore — pick the right one)
· Git
Choose between git reset --soft/--mixed/--hard, git revert, git commit --amend, and git restore based on whether the commit was pushed and whether you want to keep the changes.