We introduce in a dynamic–contracting framework with moral hazard the possibility of recapitalization as an alternative to liquidation when a firm is in financial distress. This is achieved by considering a loss–averse agent and by allowing (but not requiring) the latter to inject additional capital into the firm when necessary. We show that firm recapitalization may arise in an optimal, long–term contract. As a consequence, we find that there are two mechanisms at a firm’s disposal so as to deal with financial difficulties: one corresponds to a recapitalization process, the other to a liquidation one. The choice of mechanism is based on a cost–benefit analysis.