Surah Al-Ma'idah 5:93
لَيْسَ عَلَى ٱلَّذِينَ ءَامَنُوا۟ وَعَمِلُوا۟ ٱلصَّـٰلِحَـٰتِ جُنَاحٌ فِيمَا طَعِمُوٓا۟ إِذَا مَا ٱتَّقَوا۟ وَّءَامَنُوا۟ وَعَمِلُوا۟ ٱلصَّـٰلِحَـٰتِ ثُمَّ ٱتَّقَوا۟ وَّءَامَنُوا۟ ثُمَّ ٱتَّقَوا۟ وَّأَحْسَنُوا۟ ۗ وَٱللَّهُ يُحِبُّ ٱلْمُحْسِنِينَ
There is not upon those who believe and do righteousness [any] blame concerning what they have eaten [in the past] if they [now] fear Allāh and believe and do righteous deeds, and then fear Allāh and believe, and then fear Allāh and do good; and Allāh loves the doers of good.
Translation: Saheeh International
Tafsir
Those who believe and perform righteous deeds are not at fault in what they may have consumed of wine and indulged in of gambling before the prohibition so long as they fear the forbidden things and believed and performed righteous deeds and then were God-fearing and believed and then adhered to fear of God and belief …
Excerpt from Tafsir al-Jalalayn, commentary on 5:93, via Quran.com. The reader has the full commentary and 9 more tafsirs.