Sure Al-Maaida

5:39

فَمَن تَابَ مِنۢ بَعْدِ ظُلْمِهِۦ وَأَصْلَحَ فَإِنَّ ٱللَّهَ يَتُوبُ عَلَيْهِ ۗ إِنَّ ٱللَّهَ غَفُورٌۭ رَّحِيمٌ

Wer aber bereut, nachdem er Unrecht getan hat, und es wieder gutmacht, so nimmt Allah seine Reue gewiß an. Allah ist Allvergebend und Barmherzig.

Tafsir 5:39

Whoever repents to Allah from the crime of theft and sets right his action, then Allah, out of His grace, will accept His repentance. That is because Allah forgives the sins of those who repent to Him and is Merciful towards them. However if such a matter were to reach the court of law the legal punishment cannot be dismissed by repentance.