" I am married with a child, and I am a government employee." Did you not realise this when you were getting involved with wife of another man?
Anyhow, you're not the only one in the world doing all this many more exists who will be reading this.
Section 497 IPC is bailable offence, bail is matter of right and there is no arrest taking place so no need for any anticipatory bail. It is non-cognisable offence, hence no role of Police unless the section 497 IPC is attached with provision of IPC which is with regard to cognisable offence. The direct criminal complaint u/s 497 IPC filled with the Judicial Magistrate by the Complainant Husband and summons issued to the accused by the court for appearance only after the pre-summoning evidence is recorded by the complainant in the court and the court is satisfied that the prime facie offence u/s 497 IPC has been committed by the accused.
The evidence that show the offence of adultery u/s 497 IPC has to be good enough that the complainant can use for complete prosecution of the accused, so mere whatsapp messages, phone call recordings, and recording of the confession by wife may not be good enough for the court to issue summons to the accused. The wife if make statement on oath in the court that she was in physical relationship with another man/accused during her existing marriage can make big difference, not only the court will summon the accused in that case but may even ultimately hold him guilty of the offence u/s 497IPC.
So the best precaution that has to be taken in such case to prevent the wife with whom you had gala good time should not be going in the court for recording her statement on oath about the physical relationship with you. Apart from these the evidence of eye witnesses to the incidence, video recording duly proved as genuine and valid in the court, record of the place where both parties stayed together for physical relationship, like hotel, motel etc. records of these places and identification by the staff of these places.
As a government official if the criminal complaint case initiates you will be supposed to inform your department about it, what disciplinary action taken will depend on the rules and regulation of the particular government department. Suspension for the job and half compensatory salary is usual action taken in most case apart from departmental inquiry and punishment.
The time the criminal complaint case in court may take few years to finalise so for next 5-8 years (trial as well appeal, revision etc.) call it a years off from your job that will give more time with your own wife and child.