An in situ hydrogen generation and storage technique is demonstrated during the electrodeposition of hexagonal closed pack (HCP) nickel from NiCl2-1-ethyl-3-methylimidazolium chloride (NiCl2-EmimCl) and NiCl2·6H2O-1-ethyl-3-methylimidazolium chloride (NiCl2·6H2O-EmimCl) melts. During electrolysis, the dissolution of hydrogen in nickel takes place due to the electrolysis of water. This results in the production of HCP nickel. The hydrogen content of the electrodeposited nickel from NiCl2-EmimCl was found to be 1.2wt.%. Thermal analysis showed that the phase transformation from HCP nickel to FCC occurred at 462°C, releasing hydrogen in the process.