Updates files in the index and the working tree to match the content of the commit pointed at by HEAD.
repository to check out (must be non-bare)
specifies checkout options (may be NULL)
0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing branch, GIT_ERROR otherwise (use giterr_last for information about the error)