‘Amr ibn al-‘As reported: I came to the Prophet, peace and blessings be upon him, and I said, “Stretch out your hand that I may pledge allegiance to you.” The Prophet reached out but I clenched my hand. The Prophet said, “What is the matter with you, O ‘Amr?” I said, “I wish to make a condition.” The Prophet said, “What is your condition?” I said, “That I will be forgiven.” The Prophet said, “Did you not know that Islam demolishes the sins before it? And that emigration demolishes the sins before it? And that the Hajj pilgrimage demolishes the sins before it?”
Source: Ṣaḥīḥ Muslim 121
Grade: Sahih (authentic) according to Muslim
عَن عَمْرو بن الْعَاصِ قَالَ أَتَيْتُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقلت ابْسُطْ يَمِينَكَ فَلأُبَايِعْكَ فَبَسَطَ يمينه فَقَبَضْتُ يَدِي فَقَالَ مَا لَكَ يَا عَمْرُو قُلْتُ أَرَدْتُ أَنْ أَشْتَرِطَ قَالَ تَشْتَرِطُ مَاذَا قُلْتُ أَنْ يُغْفَرَ لِي قَالَ أَمَا عَلِمْتَ أَنَّ الْإِسْلَامَ يَهْدِمُ مَا كَانَ قَبْلَهُ وَأَنَّ الْهِجْرَةَ تَهْدِمُ مَا كَانَ قَبْلَهَا وَأَنَّ الْحَجَّ يهدم مَا كَانَ قَبْلَهُ
121 صحيح مسلم كتاب الإيمان باب كون الإسلام يهدم ما قبله وكذا الهجرة والحج