Ectothermic vertebrates with genotypic sex determination may adjust their sexual phenotype to early-life environmental conditions by sex reversal, with diverse theoretical consequences for population dynamics and microevolution. Environments with frequent sex-reversing effects may select for or against sex-reversal propensity depending on the relative fitness of sex-reversed individuals. Yet, empirical data on the adaptive value and evolutionary potential of rex reversal is scarce. Using a common-garden experiment with agile frogs (Rana dalmatina) that respond to larval heat stress by sex reversal, we demonstrate that sex-reversal rate is higher in sibgroups originating from anthropogenic habitats where sex-reversing heat events are more frequent, compared to populations inhabiting cooler woodlands. Furthermore, among genotypically female juveniles, phenotypic males are larger than sex-concordant females. These results suggest that sex-reversal propensity increased in anthropogenic environments by adaptive microevolution. Thus, environmental sex reversal may provide an adaptive strategy for ectothermic vertebrates to cope with challenges of the Anthropocene.