Plants influence the atmosphere through fluxes of carbon, water and energy1, and can intensify drought through land-atmosphere feedback effects2-4. The diversity of plant functional traits in forests, especially physiological traits related to water (hydraulic) transport, may have a critical role in land-atmosphere feedback, particularly during drought. Here we combine 352 site-years of eddy covariance measurements from 40 forest sites, remote-sensing observations of plant water content and plant functional-trait data to test whether the diversity in plant traits affects the response of the ecosystem to drought. We find evidence that higher hydraulic diversity buffers variation in ecosystem flux during dry periods across temperate and boreal forests. Hydraulic traits were the predominant significant predictors of cross-site patterns in drought response. By contrast, standard leaf and wood traits, such as specific leaf area and wood density, had little explanatory power. Our results demonstrate that diversity in the hydraulic traits of trees mediates ecosystem resilience to drought and is likely to have an important role in future ecosystem-atmosphere feedback effects in a changing climate.