What does the caret (^) character mean?

前端 未结 8 939
广开言路
广开言路 2020-11-29 17:24

I saw an answer to a question here that helps restore a deleted file in git.

The solution was

git checkout ^ -- 

        
8条回答
  •  天涯浪人
    2020-11-29 18:03

    The ^ (caret) can also be used when specifying ranges.

    To exclude commits reachable from a commit, a prefix ^ notation is used. E.g. ^r1 r2 means commits reachable from r2 but exclude the ones reachable from r1.

    Include commits that are reachable from (i.e. ancestors of) .

    ^

    Exclude commits that are reachable from (i.e. ancestors of) .

提交回复
热议问题