What are checkouts in git?
I know once you do checkout to a particular branch, the HEAD points to that branch. But what does
Let me explain some use cases of checkout with file, folder and branches so that it might be helpful in understanding.
Let say we have folder named dev and index.html also Everything is tracked and working directory is clean.
If I accidentally change file name index.html and I want to undo that i will simply use git checkout index.html it will recover that file state from repository currently selected branch.
Now if I made some change in dev folder and want to recover that. I can use git checkout dev but what if there is already branch named dev instead of checking out that folder it will pull down that branch. To avoid that I would rather do git checkout -- dev.
Now here bare double dash stands for current branch and asking git for folder dev from currently selected branch.
Similarly If I do git checkout alpha dev it will pull down dev folder from alpha branch.
This answer is for your first question 'git checkout really mean'.