Surah An-Nisa 4:17
إِنَّمَا ٱلتَّوْبَةُ عَلَى ٱللَّهِ لِلَّذِينَ يَعْمَلُونَ ٱلسُّوٓءَ بِجَهَـٰلَةٍ ثُمَّ يَتُوبُونَ مِن قَرِيبٍ فَأُو۟لَـٰٓئِكَ يَتُوبُ ٱللَّهُ عَلَيْهِمْ ۗ وَكَانَ ٱللَّهُ عَلِيمًا حَكِيمًا
The repentance accepted by Allāh is only for those who do wrong in ignorance [or carelessness] and then repent soon [after]. It is those to whom Allāh will turn in forgiveness, and Allāh is ever Knowing and Wise.
Translation: Saheeh International
Tafsir
The repentance that God accepts that is the one which He has prescribed for Himself to accept out of His bounty is only of those who do evil an act of disobedience in ignorance bi-jahālatin a circumstantial qualifier in other words ‘they are ignorant’ while they are disobeying their Lord; …
Excerpt from Tafsir al-Jalalayn, commentary on 4:17, via Quran.com. The reader has the full commentary and 9 more tafsirs.