Actualy , what Git did, when ran git checkout branch_name : I have one repository which named as '**test-repo**'

now I have 2branches on above repository named as :

 1. master
 2. master-bkp

both branches contains only one file named as **test.txt**

and **test.txt->master** contains 

    hello I am here

and **test.txt->master-bkp** contains 
    
    hello I am there

now on local I write below command

    git checkout master
    git merge master-bkp

now **test.txt->master** contains 

    hello I am here
    hello I am there

now someone can explain how internally git works when i trigger below command :

    git checkout master
    git checkout master-bkp

**Note :** Please don't start to giving opinion on 'git checkout' , I need explanation about internal logic behind it. 