قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " إِذَا اسْتَيْقَظَ أَحَدُكُمْ فَلا يَضَعْ يَدَهُ عَلَى الْوَضُوءِ حَتَّى يَغْسِلَهَا، إِنَّهُ لا يَدْرِي أَحَدُكُمْ أَيْنَ بَاتَتْ يَدُهُ "
And the Messenger of Allah, peace and blessings be upon him, said: "When any one of you wakes up from sleep, he should not put his hand into the water for ablution before washing it, for he does not know where his hand spent the night."
Related hadith on this topic