I have the following graph when I run the command git log --oneline --decorate --graph --all
:
* 7ee76a4 (HEAD) added 2.txt
| * 2ff2a0c (master) changed line of 1.txt
|/
* 9a0825b Initial commit
Since head is not in any branch, When I checkout to lets say the 'master' branch with git checkout master
the 'HEAD' goes vanished and I have as a graph result the:
* 2ff2a0c (HEAD -> master) changed line of 1.txt
* 9a0825b Initial commit
The question that I have is the following:
Shouldn't the 7ee76a4 commit really get deleted? Although I don't see it in the graph (and it seems deleted), when I do git checkout 7ee76a4
, Git takes me back to the previous state (which means that the commit isn't deleted).
Am I forgetting something?