How to undo commit, put into new branch then do a PR?

Viewed 1134

I have a master branch that is protected with push only by PR.

Say I thoughtlessly on master:

git add .
git commit -m "bunch of changes"

But I push to the branch and am rejected because the branch is protected. How do I backtrack, preserve my changes, and do a PR?

2 Answers
Related