If it's just one commit, you can simply do
git reset HEAD~1
git stash
git checkout anotherbranch
git stash pop
And if you want to put it in a fresh new branch, another way is
git branch newbranch
git reset --hard HEAD~1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…