It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever forgets to wipe his head and remembers it while he is praying, and finds moisture in his beard, let him take some of it and wipe his head with it; that will suffice him. And if he does not find any moisture, let him repeat both the ablution and the prayer."
Hadith Referenceالمعجم الأوسط / باب الميم / 7573
Hadith Gradingمحدثین:إسناده ضعيف جدًّا، فيه نهشل بن سعيد كذاب
Hadith Takhrij«قال الهيثمي: فيه نهشل بن سعيد وهو كذاب «مجمع الزوائد ومنبع الفوائد، ج 1، ص 240»» «قال الطبراني: لم يروه عن الضحاك إلا نهشل بن سعيد تفرد به عن عامر بن إبراهيم «الإعلام بسنته عليه الصلاة والسلام بشرح سنن ابن ماجه الإمام، ج 1، ص 437»»