move to new branch code example
Example 1: git transfer changes to another branch
git stash
git checkout -b new-branch
git stash pop
Example 2: how to move unstaged changes to different branch
git stash
git checkout -b new-branch
git stash pop
git stash
git checkout -b new-branch
git stash pop
git stash
git checkout -b new-branch
git stash pop