git stash //you can stash the changes in the master branch . git checkout -b newbranchname //then checkout the branch git stash pop //and pop the changes here