Translation
(91) Interpretation of Dreams
كتاب التعبير
(10) Chapter: Whoever saw the Prophet (saws) in a dream
(10) باب مَنْ رَأَى النَّبِيَّ صلى الله عليه وسلم فِي الْمَنَامِ
Sahih al-Bukhari 6995 

Narrated Abu Qatada:

The Prophet (ﷺ) said, "A good dream is from Allah, and a bad dream is from Satan. So whoever has seen (in a dream) something he dislikes, then he should spit without saliva, thrice on his left and seek refuge with Allah from Satan, for it will not harm him, and Satan cannot appear in my shape."

حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، عَنْ عُبَيْدِ اللَّهِ بْنِ أَبِي جَعْفَرٍ، أَخْبَرَنِي أَبُو سَلَمَةَ، عَنْ أَبِي قَتَادَةَ، قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ، وَالْحُلْمُ مِنَ الشَّيْطَانِ، فَمَنْ رَأَى شَيْئًا يَكْرَهُهُ فَلْيَنْفِثْ عَنْ شِمَالِهِ ثَلاَثًا، وَلْيَتَعَوَّذْ مِنَ الشَّيْطَانِ، فَإِنَّهَا لاَ تَضُرُّهُ، وَإِنَّ الشَّيْطَانَ لاَ يَتَرَاءَى بِي ‏"‏‏.‏
Reference : Sahih al-Bukhari 6995
In-book reference : Book 91, Hadith 14
USC-MSA web (English) reference : Vol. 9, Book 87, Hadith 124
  (deprecated numbering scheme)