The verse "That Allah may forgive you your past and future sins" [Fath 48:2] was revealed to the Prophet ﷺ on his return from Hudaybiyyah. The Prophet ﷺ said, "A verse has been revealed to me that is dearer to me than everything on earth." Then the Prophet ﷺ recited it to them.They said, "Congratulations and blessings, Messenger of Allah. Allah has made clear to you what He will do for you, but what will He do for us?"So the verse was revealed to him, "That He may admit the believing men and believing women into gardens beneath which rivers flow," until he reached "a great triumph" [Fath 48:5].He said, this is a hasan sahih hadith, and on this topic there is also a narration from Majma bin Jariya.
حدثنا عبد بن حميد حدثنا عبد الرزاق عن معمر عن قتادة
نزلت على النبي ﷺ {ليغفر لك الله ما تقدم من ذنبك وما تأخر} مرجعه من الحديبية فقال النبي ﷺ لقد نزلت علي آية أحب إلي مما على الأرض ثم قرأها النبي ﷺ عليهم فقالوا هنيئا مريئا يا رسول الله قد بين الله لك ماذا يفعل بك فماذا يفعل بنا فنزلت عليه {ليدخل المؤمنين والمؤمنات جنات تجري من تحتها الأنهار} حتى بلغ {فوزا عظيما} قال هذا حديث حسن صحيح وفيه عن مجمع بن جارية
[Sahih] Muslim also narrated it in the Book of Jihad, chapter on the treaty of Hudaybiya, no. 1786, from the hadith of Qatada, containing only the marfu portion. It also contains a narration from Mujammi bin Jariya [Abu Dawud, no. 2736, 3015, with a hasan chain of transmission].