If surgery is the only (or best) option for repairing rectus diastasis, then you need to wait for at least one year after childbearing. This enables your body to fully heal and get ready for the procedure. This also gives enough to finish breastfeeding (at least over a few months) and try nonsurgical solutions such as exercise and diet.