كتاب الرؤيا
42  
The Book of Dreams
Sahih Muslim 2262

Jabir reported Allah's Messenger (ﷺ) as saying:

If anyone sees a dream which he does not like, he should spit on his left side three times, and seek refuge with Allah from the Satan three times, and let him turn over from the side on which he was sleeping.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا ابْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنْ أَبِي، الزُّبَيْرِ عَنْ جَابِرٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ إِذَا رَأَى أَحَدُكُمُ الرُّؤْيَا يَكْرَهُهَا فَلْيَبْصُقْ عَنْ يَسَارِهِ ثَلاَثًا وَلْيَسْتَعِذْ بِاللَّهِ مِنَ الشَّيْطَانِ ثَلاَثًا وَلْيَتَحَوَّلْ عَنْ جَنْبِهِ الَّذِي كَانَ عَلَيْهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2262
In-book reference : Book 42, Hadith 8
USC-MSA web (English) reference : Book 29, Hadith 5620
  (deprecated numbering scheme)