Basic Knowledge
How to Git Delete Last Commit Safely
We’ve all been there. You make a commit, and a split second later, you spot a mistake. It’s a classic facepalm moment. When you need to quickly delete the last commit—the one you haven't pushed yet—your go-to command is git reset --soft HEAD~1.