OMG I forgot to create the feature branch and commited on master

SO you did the evil thing and commited on master (or any othere wrong branch) instead of the right one.

This is what you could do:

git checkout -b feature/xyz  
git checkout master  
git reset --soft HEAD~{count of commits}  
# I tend to use --soft over --hard so I don't mess up again if I miscounted the numer of commits.
# So here I check if I got the right commit. If I do I keep up with the following:
git clean -f  
git checkout feature/xyz  

Now you have the commits you did on a right branch, keep in mind that this only works if you hadn't pushed already. If you did already push your changes. You need to force push the branch agains, but only do that if you are sure nobody has the changes.

The command for a force push is git push -f <remote> <branch> so it should be obvious to only push if you are 100% sure that you are on the right branch. But to be clear with a force push you push you current state to the remote that means that also changes on the remote are going to get invalid. THIS IS DANGEROUS