All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Sincere repentance from all sins wipes out the previous sins. Allah Says (what means): {Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful."} [Quran 39:53]
Besides, the Prophet said: “Allah forgives whoever repents to Him”. [Al-Bukhaari and Muslim]
So, you should repent from what you did and regret having done it and seek Allah’s Forgiveness as much as possible.
You should also follow any sin that you had committed by a good deed, as good deeds wipe out previous sins.
As for how you could know that Allah has forgiven you this sin, then we do not know. But if you feel much remorse for what you have done and you fear not to have your repentance accepted, and you feel like doing more good deeds than before, then these are signs of a true and sincere repentance.
Allah knows best.