Git Push Secret

We make a bunch of changes and commit them only to find out we were on the master branch. How do we solve this problem? Any attempts to push to master are never allowed.

git checkout -b 'NewBranchName'
// should be in that branch now
git merge master
// all the commits on master are brought over to new branch
git push
//all changes are pushed up via the new branch!

Ah, yes! We saved the ship from sinking.