I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that
You can do the following things to overcome this issue.
-f
option to ignore the changes.If you want to save the changes:
git stash
, switch the branch, do your work, switch back to the
original branch and do git stash apply
.