git checkout <branch> moves uncommitted changes to the new branch
Recently I started creating temporary branches in my git repo to be able to move my temporary changes & not to corrupt my main branch.
I realized that unless I do not commit the temporary changes in the new branch, those changes come back to the main branch once I switch back to the main branch. This was not obvious to me. Sharing the pro-tip in case you are someone like me :).
Written by Ashish Sharma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#