Atharvaveda Parishishta (Jyotisha Selections) · by Vedic sages (Atharvaveda)
Chapter 20 · Dreams (Svapnadhyaya)
स्वप्नाध्याय
विप्रेभ्यः शक्तितो दानं शान्तिः स्वष्ट्ययनादयः ।विनाशयन्ति दुःस्वप्नं प्रातश्चाश्वत्थसेवनम् ॥
In the full Atharvaveda Parishishta this is Parishishta 68, 2.60.
Gifts to brahmins, as one can afford, calming rites, svastyayana (a blessing rite) and the like remove a bad dream. So does serving the pipal tree in the morning.
Simple meaning: Gifts, calming and blessing rites, and serving the pipal tree at dawn are said to remove a bad dream.
अश्वत्थसेवा तिलपात्रदानं गोस्पर्शनं ब्राह्मणतर्पणं च ।
Pipal worship, sesame gifts, touching a cow, feeding brahmins and calming rites are said to remove a bad dream.
वसनकनकदानदेवपूजा गुरुगोष्ठनिषेवितानि कुर्युः ।
Gifts, worship, serving teachers and seeing cows, bulls or kings tend to bring good luck after a bad dream.
इमान्दृष्ट्वाशुभान्स्वप्नान्प्रातरुत्थाय सत्वरः ।
After a bad dream, the text says to rise early and wash the face with water from a river meeting.