Search code examples
gitvisual-studio-2017team-explorer

What happens to code in IDE when I connect to different branch without committing code?


I have checked-out a branch (BranchA), made changes to the code.

Then I connect to different branch (BranchB) without committing code from IDE.

The changes I had made on BranchA in IDE are lost?


Solution

  • Usually, you cannot check-out another branch if you have unsaved changes. You either commit those (i.e. everything is saved) or explicitly discard the changes (i.e. everything is lost) and only then check-out the other branch so that there is no ambiguity.