Repairing metal micro-defects at the atomic level is very challenging due to their random dispersion and difficulty in identification. At the same time, the interaction of hydrogen with metal may cause hydrogen damage or embrittlement, endangering structural safety. As a result, it is critical to speed up the dehydrogenation of hydrogen-containing materials. The applied electric field can repair the vacancy defects of the material and accelerate the dehydrogenation of the hydrogen-containing metal. The influence of the external environment on the diffusion coefficient of hydrogen in polycrystalline metals was researched using molecular dynamics in this article, and the mechanism of hydrogen diffusion was investigated. Simultaneously, the mechanical characteristics of Fe3Cr alloy were compared during typical heat treatment and electrical treatment. The effect of temperature, electric field strength, and electric field direction on the diffusion coefficient was investigated using orthogonal test analysis. The results demonstrate that temperature and electric field strength have a significant impact on the diffusion coefficient. The atom vibrates violently as the temperature rises, breaking past the diffusion barrier and completing the atomic transition. The addition of the electric field adds extra free energy, decreases the atom's activation energy, and ultimately enhances the atom's diffusion coefficient. The repair impact of vacancy defects under electrical treatment is superior to that of typical annealing treatment for polycrystalline Fe3Cr alloy. The electric field can cause the dislocation to migrate, increasing the metal's toughness and plasticity. This research serves as a useful reference for the electrical treatment of metal materials and offers a method for the quick dehydrogenation of hydrogen-containing materials.