Suppose, I have committed four commits and they are c1, c2, c3, c4 in order. Now i am checking out c1 commit but then i decide to go back to C4 ( Let's say I have stored the commit ID of c4). Will c2 and c3 commits be reflected if I directly jump from c1 to c4?
Asked
Active
Viewed 362 times
0
-
1What do you mean by "reflected"? – jub0bs Aug 22 '15 at 18:18
-
By reflected, i meant will we be able to see commits c2 and c3 again? – J. Ramani Aug 23 '15 at 18:09
1 Answers
1
I tried from the command line and it does reflect c2 and c3.
~$ mkdir test
~$ cd test/
~$ git init
~$ touch test.txt
~$ echo "1" >> test.txt
~$ git add .
~$ git commit -m 'c1'
~$ echo "2" >> test.txt
~$ git commit -am 'c2'
~$ echo "3" >> test.txt
~$ git commit -am 'c3'
~$ echo "4" >> test.txt
~$ git commit -am 'c4'
~$ git log
~$ git checkout e3c8d3fdede3c62cbbd023961d3b6eec8aa6c47d
~$ cat test.txt
~$ git checkout 410bf3153ed1a74a1a29cccb41666dfd0eab0862
~$ cat test.txt

ooXei1sh
- 3,459
- 2
- 27
- 47