Earlier quoted context omitted.
It's usually not necessary for checkout either
What does -- do exactly?
Git checkout and a few other commands also use it to separate branch and the rest of paths, because you could specify like this
git checkout branch path1 path2
git checkout path1 path2
git checkout branch # what if there's a file named "branch"?
-- help disambiguates that by being between the branch and the paths, so git checkout branch -- # always checkout a branch
git checkout -- path1 path2 # always checkout paths
git checkout branch -- path1 path2 # same, but disable disambiguation logic