What is the problem that eclipse uses git as a codebase to switch branches?

switch the branch of git, find that the modified code under one branch is also switched to another branch (the code is not committed), and then roll back the code in one branch and restore the code that has been modified and not committed in the other branch. What is the reason for this? As far as I understand it, different branch code should be different, why modified uncommitted code can be seen in different branches?

May.28,2022

this is normal.
switching branches only changes the code in the branches, and your local changes are not saved, so they are still there.

Menu