Narrated Ibn 'Abbas:
"The Prophet (ﷺ) was in Makkah, then Hijrah was ordered, so the following was revealed to him: Say: 'My Lord! Let my entry be good, and likewise my exit be good. And grant me from You a helping authority (17:80).'" (ES)
English reference (ES): Vol. 5, Book 44, Hadith 3139 (ES)
Arabic reference (ES): Book 47, Hadith 3432 (ES)