To commit changes to new branch with git you can use the following three steps:
Create a new branch
This will leave your current branch unedited, create a new branch called mynewbranchname, and you still have your uncommitted changes. It’s the parameter -b that tells git to create a new branch with a selected name.
This adds your new files for git to track in the new branch.
This commits the files, and you’re done! The parameter -a tells git to automatically stage files that have been modified and/or deleted. and -m tells git that you provide a commit message.
Read more about commit in the git docs.