how to create new branch in git with local changes code example Example: commit unstaged changes to new branch git checkout -b new_branch_name