You can just create a new branch and switch onto it. Commit your changes then:
git branch dirty
git checkout dirty
// And your commit follows ...
Alternatively, you can also checkout an existing branch (just git checkout <name>
). But only, if there are no collisions (the base of all edited files is the same as in your current branch). Otherwise you will get a message.