Hilchos Lashon Hara chapter 6, section 12

If one transgressed and believed lashon hara regarding sins against God or man one should strive to remove the belief from one’s heart, accept upon oneself to never again believe lashon hara, and confess the wrongdoing. This will repair the sins involved as explained in the introduction unless one already repeated the lashon hara to others.