We recently found that the coercivity and anisotropy of SmCo5 can be reversibly controlled with huge amplitudes by applying voltages of only 1 V. This is implemented by the voltage-driven insertion and extraction of hydrogen atoms in interstitial sites. This breaks the limitations imposed by short electric-field screening and thus opens an avenue for practical applications such as voltage-assisted magnetic recording. However, the mechanism behind the huge change of magnetic properties remains unresolved, for instance how hydrogen atoms interact with neighboring atoms and how magnetic moments change.Here, it is proposed to monitor the dynamic change of magnetic moments of Co and Sm atoms during the in situ hydrogen charging/discharging. It would reveal the change of local magnetic and electronic structures at elemental basis.