I have a master branch
now for some testing other things I made a branch A
I checkout branch A modify the file and when I checkout master again the changes are t
Uncommitted changes will move from one branch to other. To keep them separated, you must stash
those changes before moving to another branch. When you return to your branch, you can apply
those changes to retrieve them.
As seen below:
>$ git status
On branch branch_1
Your branch is up-to-date with 'origin/branch_1'.
modified: dir/file.rb
>$ git stash
>$ git checkout
>$ git checkout #after finishing your tasks in branch_2 you can go back to branch_1
>$ git stash apply
Now you will get back the changes you have done earlier in branch_1