Answering the question, to Dr. `Abd al-Fattah Idris, professor of Islamic jurisprudence in Al-Azhar University, said,

After repentance the man can marry the one he had affair with, and if it overcomes his thought that this child belongs to him, then he can register it on his name after marrying her. But without marriage he cannot do this. In this case the child will be Muslim because in Islamic shari`ah a child follows the best religion of his parents’.

So, in order to not abandon this child and leave it for disbelief, he should seek marriage with this woman. This marriage could be also a way for her to accept Islam through the husband’s guidance and good manners and religiosity.

If she does not agree to marry, the man can agree with her to make a marriage contract to enable him to take the custody of the child and then she may go her way. But if all these ways prove useless and he did all his best to correct the mistake, then he is not responsible for this child.