Sayyiduna Abu Umamah (may Allah be pleased with him) said that a man asked the Prophet (peace and blessings be upon him) for permission (to commit) fornication. The narrator said: Those sitting near the Prophet (peace and blessings be upon him) tried to seize him. The Prophet (peace and blessings be upon him) said: "Leave him." Then he (peace and blessings be upon him) said: "Come closer. Would you like fornication to be committed with your sister?" He said: No. He (peace and blessings be upon him) asked: "With your daughter?" The narrator said: He (peace and blessings be upon him) kept saying this to him repeatedly, and each time he answered in the negative. He (peace and blessings be upon him) said: "Then you too should dislike what Allah dislikes, and love for your brother what you love for yourself." The man said: O Messenger of Allah! Supplicate to Allah that He place aversion to women in my heart. The Prophet (peace and blessings be upon him) said: "O Allah, make women hateful to him." The narrator said: After a few days he came back and said: O Messenger of Allah (peace and blessings be upon him)! Nothing is more hateful to me than women; now permit me to roam the land (siyahah). He (peace and blessings be upon him) said: "The roaming (siyahah) of my ummah is in jihad in the path of Allah."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18507