Superhydrophobicity, the enhanced hydrophobicity of surfaces decorated with textures of suitable size, is associated with a layer of gas trapped within surface roughness. The reduced liquid/solid contact makes superhydrophobicity attractive for many technological applications. This gas layer, however, can break down with the liquid completely wetting the surface. Experiments have shown that the recovery of the "suspended" superhydrophobic state from the wet one is difficult. Self-recovery-the spontaneous restoring of the gas layer at ambient conditions-is one of the dreams of research in superhydrophobicity as it would allow to overcome the fragility of superhydrophobicity. In this work we have performed a theoretical investigation of the wetting and recovery processes on a set of surfaces characterized by textures of different dimensions and morphology in order to elucidate the optimal parameters for avoiding wetting and achieving self-recovery. Results show that texture size in the nanometer range is a necessary but not sufficient condition for self-recovery: the geometry plays a crucial role, nanopillars prevent self-recovery, while surfaces with square pores exhibit self-recovery even at large positive pressures. However, the optimal morphology for self-recovery, the square pore, is suboptimal for the functional properties of the surface, for example, high slippage. Our calculations show that these two properties are related to regions of the texture separated in space: self-recovery is controlled by the characteristics of the bottom surface, while wetting and slip are controlled by the cavity mouth. We thus propose a modular design strategy which combines self-recovery and good functional properties: Square pores surmounted by ridges achieve self-recovery even at 2 MPa and have a very small liquid/solid contact area. The macroscopic calculations, which allowed us to efficiently devise design criteria, have been validated by atomistic simulations, with the optimal texture showing self-recovery on atomic time scales, τ ∼ 2 ns.