I have created a file sample1 on master branch and edited it with a line "changes made to file in master". It was still untracked file as I did not add to git yet.
Then I created a branch using
git checkout -b feature_branch
First thing I observed was the file sample1 was visible in the new feature_branch. I think this is ok.
Then I made changes to this file in the feature_branch.
I then went back to master branch using
git checkout master
I opened the file and to my surprise, I see the changes made in feature branch in the master without me committing the changes or merging the files.
And then I made changes to the master again and switched to feature_branch and still found the changes.
Can anyone explain if this is intended behaviour?