I often commit a change, then before I push I realize “Oops, I’m on the...
I often commit a change, then before I push I realize “Oops, I’m on the wrong branch!”. 🤦♂️
Here’s how I fix it:
git reset --soft HEAD~
This is basically "undo" for the last commit. If I’ve made a few commits that I haven’t pushed yet, I run this once per commit.