Make the repository HEAD point to the specified reference.
If the provided reference points to a Tree or a Blob, the HEAD is unaltered and -1 is returned.
If the provided reference points to a branch, the HEAD will point to that branch, staying attached, or become attached if it isn't yet. If the branch doesn't exist yet, no error will be return. The HEAD will then be attached to an unborn branch.
Otherwise, the HEAD will be detached and will directly point to the Commit.
Canonical name of the reference the HEAD should point at
0 on success, or an error code