Now that the situation you described has taken place, your duty is to go back to the judge who certified that document and inform him of the facts so that he can undo the effects of your testimony. This is what is required of you.
***
Boycotting Those Who Spread Rumors
Question: Some people are circulating a false rumor about me and describing me with vile attributes, even though I am innocent of what they claim. I have cut off contact with them so that nothing worse might happen, and since doing so I have felt at ease. Am I justified in boycotting them? By bearing their abuse with patience, will I gain good deeds from them? Please advise me thoroughly.
Answer: First, set matters right between yourself and Allah and correct any faults you may have. After that, anything people say about you will not harm you if they are wrong; the sin is on them. At the same time, you should avoid keeping their company as long as they persist in describing you in that way and causing you harm and distress. Do not associate with them, for doing so under these circumstances may lead to further corruption—perhaps aggression, poor relations, or other undesirable outcomes. Therefore, stay away from them—unless your continued association, together with reforming your own behavior and rectifying your mistakes, would remove the ill thoughts they hold against you. In that case, remaining with them would be commendable. But if being with them only increases the evil and the accusations, then distance yourself from them, put your relationship with Allah in order, and no one will be able to harm you.