It is narrated from Amir al-Mu'minin Sayyiduna Ali (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever leaves even a hair's breadth unwashed during the ritual bath of janabah will face a severe punishment of Hell." Sayyiduna Ali (may Allah be pleased with him) said: "Because of this, I became an enemy to my own head," and he used to shave his hair.
Hadith Takhrijتخريج دیکھئے: [أبوداؤد 249] ، [ابن ماجه 599] ، [مصنف ابن أبى شيبه 100/1] ، [مسند أحمد 94/1] ، [تهذيب الآثار مسند على 41، 42]
Brief Explanation
(Commentary on Hadith 773)
There is considerable discussion regarding the chain of narration of this hadith, and the scholars differ concerning its authentication and weakening. However, in the ritual bath (ghusl) of major impurity (janabah), care and thoroughness are necessary, just as when performing ablution (wudu), if the heel remains dry, there is a severe warning of punishment. The reason for the diligence of Sayyiduna Ali radi Allahu anhu and his cutting of his hair was precisely this.