git transfer changes to another branch

C++
git stash
git checkout -b new-branch
git stash popgit stash
git checkout -b new-branch
git stash pop
git stash
git checkout correct-branch
git stash pop

Source

Also in C++: