0

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?

Zoe
  • 27,060
  • 21
  • 118
  • 148
J. Ramani
  • 3
  • 3

1 Answers1

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