Swithing the Branch but Bringing the Previous modifications together


Hi, guys!

I am new to CLion, and also git. Currently, I am learning using git for management of code versions.

My question is that I added some code in a branch named "new"; and then I wanted to review my code in "master" branch, but after using Checkout in CLion to switch to "master" branch, I found that the added code also show up in the "new" branch.

So, if I want to switch to the "master" branch, and get its status and context as the last time I visited, instead of bringing the modifications done in other branch, is there a way to do it?

Your answer and guide will be appreciated!

1 comment

It sounds like these changes are non-conflicting ones and therefore git allows you to transfer these changes to a different branch.
If you try to run `git checkout` via command-line you will get the same results.
If there are such changes, you can go to Commit tab and then right click on changes => Shelf changes


Please sign in to leave a comment.