Narrated Mujahid:
that Ka'b bin 'Ujrah said: "By the one in Whose Hand is my soul! This Ayah was revealed referring to my case: 'And whosoever of you is ill or has an ailment on his scalp (necessitating shaving) he must pay Fidyah of either fasting or giving charity, or a sacrifice. (2:196)'" He said: "We were with the Messenger of Allah (ﷺ) at Al-Hudaibiyyah and we were in a state of Ihram. The idolaters had held us back, and I had a good deal of hair, and the lice were falling on my face. The Prophet (ﷺ) passed by me and said: 'The lice on your head are bothering you?'" He said: "I said: 'Yes.' He said: 'Then shave.' And this Ayah was revealed." Mujahid said: "The fasting is for three days, the feeding is six needy people, and the sacrifice is a sheep or more."
English reference: Vol. 5, Book 44, Hadith 2973
Arabic reference: Book 47, Hadith 3237