Question: A man grew up ignorant among ignorant people, heedless of the religion and its teachings. Then guidance spread, and he listened to the admonitions of the guides and attended their gatherings, so he repented to Allah the Exalted and turned to Him. Then he asked: How is he to act with respect to the many oaths in which he used to break his word, when he does not know how many they were, nor how many of them require an expiation?
Answer – and success is from Allah: What is obligatory upon the one who repents to Allah the Exalted, returning to Him after a long period of ignorance and heedlessness, is that he should be mindful of Allah the Exalted in what remains of his lifetime, and that he should increase in seeking forgiveness for the sins that have passed. And I do not see that expiations are due from him for what has passed of his oaths, because he grew up ignorant and heedless of the rulings of his religion; and Allah the Exalted does not call the ignorant, heedless one to account nor punish him until the call of Allah and the call of His Messenger, May Allah bless him and his family and grant them peace, reach him, as He the Exalted said: “That is because your Lord would not destroy the cities for wrongdoing while their people were unaware.” [al-An‘ām:131] And He, Glorified and Exalted, also said: “So whoever has received an admonition from his Lord and desists may have what is past, and his affair rests with Allah.” [al-Baqarah:275] And it has come in a transmitted ḥadīth: “Repentance wipes out what came before it.”
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2