How does git commit current changes to other branches?

well, I modified the code on one branch, but found that the branch was wrong. I want to commit all the current code to another branch instead of the current one.

Git
Apr.17,2021

now on the branch prod, you want to switch branches to dev, if there is no commit:

git stash
git checkout dev
git stash pop

if commit is enabled, go to the dev branch, merge prod branch, and then go back to the prod branch to roll back the version


should be git stash pop, brother!

Menu