Jabir reported the Messenger of Allah (May peace be upon him) as saying :When one of you sees a vision which he dislikes, he must spit on his left (three times), seek refuge in Allah from the devil three times, and turn from the side on which he was lying
Hadith No. 5022
Sunan Abu Dawud
Gradings:
Al-Albani:
Sahih
Muhammad Muhyi Al-Din Abdul Hamid:
Sahih
Zubair Ali Zai:
Sahih Muslim (2262)