Sahih Muslim 123 c
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
أَسْلَمْتَ عَلَى مَا أَسْلَفْتَ لَكَ مِنَ الْخَيْرِ "
It is narrate on the authority of Hakim b. Hizam:
I said: Messenger of Allah, I did so some of the deeds in the state of ignorance. (One of the transmitters Hisham b. Urwa explained them as acts of piety. Upon this the Messenger, of Allah remarked: You have embraced Islam with all the previous acts of virtue. I said: By God, I would leave nothing undone in Islam the like of which I did in the state of ignorance.
Full reference and source
Sahih Muslim 123 c In-book : Book 1, Hadith 232 USC-MSA web (English) : Book 1, Hadith 224 (deprecated)
View source on Sunnah.com (opens in a new tab)