Stem cell-based therapies can potentially reverse organ dysfunction and diseases but the removal of impaired tissue and reactivation of the program leading to organ regeneration pose major challenges. In mice, a four-day fasting mimicking diet (FMD) induces a step-wise expression of Sox17 and Pdx-1, resembling that observed during pancreatic development and followed by Ngn3-driven generation of insulin-producing β-cells. FMD cycles restore insulin secretion and glucose homeostasis in both a type 2 and type 1 diabetes mouse models. In human type 1 diabetes pancreatic islets, fasting conditions reduce PKA and mTOR activity and induce Sox2 and Ngn3 expression and insulin production. The effects of the FMD are reversed by IGF-1 treatment and recapitulated by PKA and mTOR inhibition. These results indicate that a FMD promotes the reprogramming of pancreatic cells to restore insulin generation in islets from T1D patients and reverse both T1D and T2D phenotypes in mouse models.