There comes a point when you need to stop compounding your mistakes. If a woman made a terrible mistake, she is best off coming clean with her husband now, rather than later. If forgiveness is forthcoming, then that is better than having not one, but two terrible secrets hidden from your husband and family.
If there is no forgiveness, then the woman has learned a hard lesson that actions, like breaking a marriage vow, have consequences. Even with a dead baby, she is still affected by what she has done. You can't uncrack that egg.
Best to be honest and own up to your mistakes.