Sunan Ibn Majah, Book 35, Hadith 18 (Ibn Majah 3912)
It was narrated from Abu Hurairah that the Messenger of Allah (ﷺ) said:
“If anyone of you sees a dream that he dislikes, let him turn over and spit dryly to his left three times, and ask Allah for its good and seek refuge from its evil.”