Why does verification sometimes put a file?

When I first started using Git, I found the command checkoutquite confusing. However, when I adapted to the Git version control model, it made sense. Now I need to teach Git to my colleagues, and I'm just trying to explain checkout. I thought I had a simple explanation (from the documentation ):

Checkout a branch or path to a working tree

It seems to combine some of the things you can do with validation, which looks like a varied set of operations for someone new to Git:

git checkout .
git checkout HEAD .
git checkout HEAD~2
git checkout feature/update-readme README.md

... except for the latter, since it does not just update the working directory, it puts the file.

How can I understand why or when the ransom will lead to the fact that something is delivered, and not just copied to the working directory?

+3
2

git checkout . ( ), HEAD , , HEAD, .

+5

, , - , ?

Git 2.21 (Q1 2019), , git checkout ( HEAD ): " git checkout [<tree-ish>] path... " , , , .

. 0f086e6 (13 2018 .) pclouds (pclouds).
( . - gitster - 4084df4, 14 2019 .)

checkout: -

" git checkout " , , .

- , . - , --quiet, :

HEAD is now at ..."
Reset branch ..."
Already on ..."
Switched to and reset ..."
Switched to a new branch ..."
Switched to branch ..."

.

-, , , , .

:

Checked out ... paths out of the index
Checked out ... paths out of <abbrev hash>

, , , " -- " .

0

Source: https://habr.com/ru/post/1677870/