The in vitro differentiation of insulin-producing beta-like cells can model aspects of human pancreatic development. Here, we generate 95,308 single-cell transcriptomes and reconstruct a lineage tree of the entire differentiation process from human embryonic stem cells to beta-like cells to study temporally regulated genes during differentiation. We identify so-called 'switch genes' at the branch point of endocrine/non-endocrine cell fate choice, revealing insights into the mechanisms of differentiation-promoting reagents, such as NOTCH and ROCKII inhibitors, and providing improved differentiation protocols. Over 20% of all detectable genes are activated multiple times during differentiation, even though their enhancer activation is usually unimodal, indicating extensive gene reuse driven by different enhancers. We also identify a stage-specific enhancer at the TCF7L2 locus for diabetes, uncovered by genome-wide association studies, that drives a transient wave of gene expression in pancreatic progenitors. Finally, we develop a web app to visualize gene expression on the lineage tree, providing a comprehensive single-cell data resource for researchers studying islet biology and diabetes.