git reset --soft HEAD~ modifies staged snapshot? -
from whatever have read git reset --soft, learned doesn't modified staging area or index. in below example can see staging area/index modified result of git reset --soft. why?
mkdir test;cd test;git init; touch a; echo 1 >>a;git add a;git commit -m"1" a; echo 2 >>a;git commit -m"2" a; git diff --cached; <no output> git reset --soft head~; git diff --cached;<see below output> --- a/a +++ b/a @@ -1 +1,2 @@ 1 +2
a commit of particular content. index indexes particular content. git diff --cached
compares indexed content against named commit. when reset head
, changed commit git diff --cached
compares against.
Comments
Post a Comment