问题
While I understand that the command in the title is akin to undo the changes to the current repository, I am unable to understand how it actually works or how to read the command. Any leads would be a great help.
回答1:
git checkout with
<paths>
[...] is used to restore modified or deleted paths to their original contents from the index or replace paths with the contents from a named (most often a commit-ish).
See documentation, especially here and here: .
is treated as <pathspec>
in your case, adressing the current directory. The current HEAD
revision of all files in the given <pathspec>
, so in your case everything in your base directory, are checked out.
回答2:
git-checkout - Switch branches or restore working tree files
Example: git checkout -b [branch]
来源:https://stackoverflow.com/questions/42992997/meaning-of-the-command-git-checkout