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
Why is that the file is shown as modified in master branch even though it was modified in git-build branch?
The key to remember is that the file was not modified in the git-build branch. It was only modified in your working copy.
Only when you commit are the changes put back into whichever branch you have checked out