Narrated Ka’ab bin Unjra: Allah’s Messenger, peace be upon him, stood beside me at Hudaibiyah and the lice were falling from my head in great number. He asked me, “Have your lice troubled you?” I replied in the affirmative. He ordered me to get my head shaved. Ka’ab added, This holy verse:

“And whoever among you is sick or has an ailment of the head and has his head shaved shall atone for this either by fasting or by alms-giving or by offering a sacri-fice. [Surah Al-Baqarah 2: 196]

was revealed regarding me [but it is also for you in general].

The Prophet, peace be upon him, ordered me either to observe Fasting (fast) for three days, or to feed six poor persons with one Faraq (i.e. three Sa’ of dates), or to slaughter a sheep, etc. (sacrifice) whatever was available.
[3: 42- O.B. Sahih Al-Bukhari)