Muwatta Malik, Book 2, Hadith 85 (USC-MSA)

Yahya related to me from Malik from Hisham ibn Urwa from his father fromYahyaibn Abd ar-Rahman ibn Ha ib that he had set off for Mumra with Umar ibn al-Khattab in a party of riders, among whom was Amr ibn al-As. Umar ibn al-Khattab dismounted for a rest late at night on a certain road near a certain oasis. Umar had a wet dream when it was almost dawn and there was no water among the riding party. He rode until he came to some water and then he began to wash off what he saw of the semen until it had gone. Amr ibn al-As said to him, "It is morning and there are clothes with us, so allow your garment to be washed. ''Umar ibn al-Khattab said to him, "I am surprised at you, Amr ibn al-As! Even if you could find clothes, would everybody be able to find them? By Allah, if I were to do it, it would become a sunna. No, I wash what I see, and I sprinkle with water what I do not see." Malik spoke about a man who found traces of a wet dream on his clothes and did not know when it had occurred and did not remember anything he had seen in his sleep. He said, "Let the intention of his ghusl be from the time when he last slept, and if he has prayed since that last sleep he should repeat it. This is because often a man has a wet dream and sees nothing, and often he sees something but does not have an emission. But, if he finds liquid on his garment he must do ghusl. This is because Umar repeated what he had prayed after the time he had last slept and not what was before it."

وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ يَحْيَى بْنِ عَبْدِ الرَّحْمَنِ بْنِ حَاطِبٍ، أَنَّهُ اعْتَمَرَ مَعَ عُمَرَ بْنِ الْخَطَّابِ فِي رَكْبٍ فِيهِمْ عَمْرُو بْنُ الْعَاصِ وَأَنَّ عُمَرَ بْنَ الْخَطَّابِ عَرَّسَ بِبَعْضِ الطَّرِيقِ قَرِيبًا مِنْ بَعْضِ الْمِيَاهِ فَاحْتَلَمَ عُمَرُ وَقَدْ كَادَ أَنْ يُصْبِحَ فَلَمْ يَجِدْ مَعَ الرَّكْبِ مَاءً فَرَكِبَ حَتَّى جَاءَ الْمَاءَ فَجَعَلَ يَغْسِلُ مَا رَأَى مِنْ ذَلِكَ الاِحْتِلاَمِ حَتَّى أَسْفَرَ فَقَالَ لَهُ عَمْرُو بْنُ الْعَاصِ أَصْبَحْتَ وَمَعَنَا ثِيَابٌ فَدَعْ ثَوْبَكَ يُغْسَلُ ‏.‏ فَقَالَ عُمَرُ بْنُ الْخَطَّابِ وَاعَجَبًا لَكَ يَا عَمْرُو بْنَ الْعَاصِ لَئِنْ كُنْتَ تَجِدُ ثِيَابًا أَفَكُلُّ النَّاسِ يَجِدُ ثِيَابًا وَاللَّهِ لَوْ فَعَلْتُهَا لَكَانَتْ سُنَّةً بَلْ أَغْسِلُ مَا رَأَيْتُ وَأَنْضِحُ مَا لَمْ أَرَ ‏.‏ قَالَ مَالِكٌ فِي رَجُلٍ وَجَدَ فِي ثَوْبِهِ أَثَرَ احْتِلاَمٍ وَلاَ يَدْرِي مَتَى كَانَ وَلاَ يَذْكُرُ شَيْئًا رَأَى فِي مَنَامِهِ قَالَ لِيَغْتَسِلْ مِنْ أَحْدَثِ نَوْمٍ نَامَهُ فَإِنْ كَانَ صَلَّى بَعْدَ ذَلِكَ النَّوْمِ فَلْيُعِدْ مَا كَانَ صَلَّى بَعْدَ ذَلِكَ النَّوْمِ مِنْ أَجْلِ أَنَّ الرَّجُلَ رُبَّمَا احْتَلَمَ وَلاَ يَرَى شَيْئًا وَيَرَى وَلاَ يَحْتَلِمُ فَإِذَا وَجَدَ فِي ثَوْبِهِ مَاءً فَعَلَيْهِ الْغُسْلُ وَذَلِكَ أَنَّ عُمَرَ أَعَادَ مَا كَانَ صَلَّى لآخِرِ نَوْمٍ نَامَهُ وَلَمْ يُعِدْ مَا كَانَ قَبْلَهُ ‏.‏

sunnah.com

also referenced under: Book 2, Hadith 115 (In-Book)