I am trying to understand this behavior of git. It has to do with file removal and preservation of a commit.
Suppose I am working in a branch called fork1 at the latest point. I get there by doing "git checkout fork1". I then delete a file called first.bsh. (Not git rm, just rm). If I do "git checkout fork1", it produces a message:
Already on 'fork1'
D first.bsh
noting the file is missing. It is not restored, despite the checkout.
I then do "checkout master" and then "checkout fork1". At this point, the file is restored. It appears that the order of the commands affects what "checkout fork1" does. That is surprising and does not seem like desirable behavior. It's sort of "respecting" my deletion in one case, but not the other. What is the logic here?