We have carried out ab initio molecular-dynamics simulations for the model system of hydrogen-adsorbed graphite to investigate the temperature-induced desorption of hydrogen atoms from the graphite and found for the first time by the ab initio electronic structure calculations the desorption of hydrogen atoms as a hydrogen dimer, which moves almost freely between graphite layers. We have also investigated the microscopic mechanism of the desorption and the dimerization of the hydrogen atoms based on the electron density distribution as well as the overlap population analysis, and clarified that the dimerization occurs through the intermediate `bridge' state such as –C–H–H–C–. Considering the increase in the temperature due to the recrystallization occurred in the nanostructured graphite, our results are consistent with the experimental results, in the sense that the recrystallization of the nanostructured graphite is necessary for the desorption of hydrogen atoms observed experimentally at higher temperature.