Abu Dawud Book 1, Hadith Number 255.
Chapter : A person who is sexually defiled is permitted to eat anything before washing.
Narated By Thawban : Shurayh ibn Ubayd said: Jubayr ibn Nufayr gave me a verdict about the bath because of sexual defilement that Thawban reported to them that they asked the Prophet (PBUH) about it. He (the Prophet) replied: As regards man, he should undo the hair of his head and wash it until the water should reach the roots of the hair. But there is no harm if the woman does not undo it (her hair) and pour three handfuls of water over her head.