Re: [PATCH 5/5] doc: git-checkout: clarify restoring files section
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 28, 2025, 20:38 UTC
- Message-ID
- <xmqq7bynuqqc.fsf@gitster.g>
- In-Reply-To
- <2efb789d-db2d-4dae-ae81-373bd231c3c6@app.fastmail.com>
"Julia Evans" <julia@jvns.ca> writes:
> $ git checkout HEAD:Documentation/ git-commit.adoc > > to restore `file.txt` into a different directory than it was originally.
It probably is handy when you want to cross a rename boundary to backport a new thing into an old history (or vice versa). Something like
$ git checkout v1.0.0
$ git checkout v1.7.1:builtin cat-file.cperhaps.
Show 5 quoted lines
> What I would tell a friend is > "<tree-ish> 99% of the time just means "commit or something > which resolves to a commit, but Git has made it more general for > a reason I don't understand", but of course that's not the right > thing to say in the Git documentation :)
You are describing commit-ish (which allows an annotated or signed tag that points at a commit).