Move a Git local commit to a new branch
I often work in the main branch and then create a new branch when I’m ready to commit changes, I find this easier than creating a new branch when I start something but it does means I sometimes commit changes to the wrong branch.
More …