If you want the working directory to match the state of the new HEAD commit then you need to check it out (e.g. with the go equivalent of
git_index_write_tree writes a tree object to the object database and
git_index_write writes the in-memory representation of the index out to disk. Neither affect the working directory.