Git: Move Uncommitted Work to New Branch

Before we start making a change, chance is high that we are still in our master branch because this is the most current one. What if while debugging, we happen to change the code in this branch then realize it should be made in new branch. The solution is to run this command:

git checkout -b new_branch

This will bring all the changes to new branch. After this, it is easy to undo the changes that is already created in master later on.