--
as a standalone argument (i.e. not part of another argument) is used by many UNIX command line programs to indicate that anything that follows it is not an argument.
Why? Well, in this case, it's being used in case you have a path whose name starts with --
, which shouldn't be interpreted as its own argument.
i.e. git checkout -- --mydirectory
which, without the --
would throw an error.