If you have ever been working on code to realize that you cannot commit the changes that you have made to the original branch you were working in, it might get a bit annoying. Fortunaltely, there is an easy way to commit your code in a new branch (without you losing any data).
In order to do that, you only need to follow three steps:
- Create a new branch in which you will commit your changes
- Switch your current working copy to this new branch
- Commit your changes to the new branch