I accidentally committed to the wrong branch. How do I delete that commit?
If you want to move that commit to another branch, get the SHA of the commit in question
git rev-parse HEAD
Then switch the current branch
git checkout other-branch
And cherry-pick the commit to other-branch
cherry-pick
other-branch
git cherry-pick