if I use git command like this:
git checkout -- .
I know its effect is to discard all unstaged files everywhere.
Can anyone tell m
The dot (.) refers to the current working directory.
.
You are asking git to checkout the current directory from the checked out branch. The double-dash is used to separate references, such as master or HEAD from file paths, such as myfile.cpp.
master
HEAD
myfile.cpp