I have a branch name test1 and I make a new branch named as test2 by following command. Currently my branch is test1 I run this command
$ git checkout -b test2 It creates the new branch and work on that test2 branch. After completing my my task on test2 branch I switch back to my original branch test1 but it also merge the changing of test2 branch that is not good. Because I want to separate the logic of both branches. Now my original branch also become unstable. I just want to know that why test2 code merge in my test1 branch when I checkout?