Praise be to Allah.
If a man divorces his wife for the first or second time (talaaq) and her ‘iddah has ended, he may take her back with a new contract that fulfils the conditions and pillars of marriage, namely the woman's consent, the wali (guardian) and two witnesses, along with the mahr (dowry).
Recording the marriage or divorce in court is not a condition of it being valid, but it protects the rights of the wife and the husband and the children, hence it should be done.
We do not see any reason not to do the marriage now and to let the previous document stand, because it will serve the purpose.
And Allah knows best.