From CO2- to H2O-dominated atmospheres and back