Sura An-Nisaa

4:17

إِنَّمَا ٱلتَّوْبَةُ عَلَى ٱللَّهِ لِلَّذِينَ يَعْمَلُونَ ٱلسُّوٓءَ بِجَهَٰلَةٍۢ ثُمَّ يَتُوبُونَ مِن قَرِيبٍۢ فَأُو۟لَٰٓئِكَ يَتُوبُ ٱللَّهُ عَلَيْهِمْ ۗ وَكَانَ ٱللَّهُ عَلِيمًا حَكِيمًۭا

Men vägen tillbaka till Gud genom ånger är öppen enbart för dem som av oförstånd begår en dålig handling och sedan ångrar [den], innan deras tid är ute. Gud vänder Sig till dem och innesluter dem på nytt i Sin nåd; Gud är allvetande, vis.

Tafsir 4:17

Allah only turns in mercy and forgiveness to those who commit disobedience and overstep the limits out of foolishness and impulse, and who repent to Allah asking for His forgiveness before the time of their death. Allah forgives these people, by overlooking their disobedience. Allah knows the circumstances of people, and is Wise in His decree and sacred laws.