git how to commit changes to another branch 1

git how to commit changes to another branch

git stash
git checkout other-branch
git stash pop

Here is what the above code is Doing:
1. git stash: Stashes the changes in a dirty working directory away
2. git checkout other-branch: Checks out the other branch
3. git stash pop: Restores the changes from the stash and removes it from the stash list

Similar Posts