Amr bin As reported,

When Allah placed Islam in my heart, I came to the Prophet ﷺ and said, "Extend your right hand so that I may pledge allegiance to you."He extended his hand, but I withdrew mine.He asked, "What is the matter, Amr?"I replied, "I wish to make a condition."He asked, "What condition?"I said, "That I be forgiven."He said, "Do you not know that Islam wipes out whatever came before it?"… the hadith continues.

Azami 12382

Sahih

عن عمرو بن العاص قال

لما جعل الله الإسلام في قلبي، أتيت النبي ﷺ، فقلت: ابسط يمينك فلأبايعك، فبسط يمينه، قال: فقبضت يدى. قال: ما لك يا عمرو. قال: قلت: أردت أن أشترط. قال: تشترط بماذا. قلت: أن يغفر لى. قال: أما علمت أن الإسلام يهدم ما كان قبله… الحديث.

الأعظمي 12382صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Say to those who disbelieve, if they cease, what has passed will be forgiven for them, and if they return, then the precedent of the former peoples has already passed"
Numbering
Jami al-Kamil 12382 (2nd edition)
Azami 12382