Using firm-level data, I analyze one of the largest economic experiments of the twentieth century, the fall of communism. After communism ended, post-communist economies experienced a sharp decline and slow recovery of output. This paper studies the output pattern of these countries using microdata from Hungary from both communist and market economy times (1986-1999). I propose a novel decomposition of output change which allows me to quantify the role of productivity, inputs and allocative efficiency in output change. I find that the majority of the output drop is accounted for by a reduction in labor input. In contrast, the recovery in the 1990s largely reflects gains from within-industry reallocation of inputs toward more productive firms. Next, I explore the mechanisms through which the fall in labor and the gains in allocative efficiency operated. I find that during communism, a large share of firms employed an inefficiently high number of people given the wages firms paid. During the transition, these firms saw their employment decrease 40% more relative to other firms. In particular, these firms shed more low-educated, blue-collar, older, and female workers. The evidence is consistent with the interpretation that the corporate sector in communism provided a social safety net in addition to producing output. With regard to the recovery, I provide evidence consistent with the bank privatization having improved allocative efficiency of capital by removing frictions caused by state banks.