Tissue damage elicits cell fate switching through a process called metaplasia, but how the starting cell fate is silenced and the new cell fate is activated has not been investigated in animals. In cell culture, pioneer transcription factors mediate "reprogramming" by opening new chromatin sites for expression that can attract transcription factors from the starting cell's enhancers. Here we report that Sox4 is sufficient to initiate hepatobiliary metaplasia in the adult liver. In lineage-traced cells, we assessed the timing of Sox4-mediated opening of enhancer chromatin versus enhancer decommissioning. Initially, Sox4 directly binds to and closes hepatocyte regulatory sequences via a motif it overlaps with Hnf4a, a hepatocyte master regulator. Subsequently, Sox4 exerts pioneer factor activity to open biliary regulatory sequences. The results delineate a hierarchy by which gene networks become reprogrammed under physiological conditions, providing deeper insight into the basis for cell fate transitions in animals.