A pulsed hollow cathode discharge in Ar and Ne is used to investigate the temporal evolution of sputtered Mg density in the afterglow phase. A diffusion model of this transport is assumed, including the process of reflection by the wall (Chantry PJ, Phelps AV, Shultz GJ. Phys Rev 1966;152:81-9 [1]; Rusinov IM, Paeva GW, Blagoev AB. J Phys D: Appl Phys 1997;30:1878-84 [2]; Suzuki S. Itoh H, Ikuta N, Sekizawa H. J Phys D: Appl Phys 1992;25:1568-74 [4]; Stewart IM. J Phys D: Appl Phys 1994;27:1487-91 [5]. Decays of ground-state Mg atom densities are recorded using an optical absorption technique. The observed decay rates reveal an essential temporal dependence. This behavior is supposed to be due to changes in the wall loss probability with time during the afterglow. The influence of adsorbed hydrogen on the properties of the wall surface is investigated. Suppression of Mg atoms sputtering and change in the wall sticking probability value for these atoms is observed in the presence of hydrogen.