How new traits originate in evolution is a fundamental question of evolutionary biology. When such traits arise, they can either be immediately beneficial in their environment of origin, or they may become beneficial only in a future environment. Compared to immediately beneficial novel traits, novel traits without immediate benefits remain poorly studied. Here we use experimental evolution to study novel traits that are not immediately beneficial but that allow bacteria to survive in new environments. Specifically, we evolved multiple E. coli populations in five antibiotics with different mechanisms of action, and then determined their ability to grow in more than 200 environments that are different from the environment in which they evolved. Our populations evolved viability in multiple environments that contain not just clinically relevant antibiotics, but a broad range of antimicrobial molecules, such as surfactants, organic and inorganic salts, nucleotide analogues and pyridine derivatives. Genome sequencing of multiple evolved clones shows that pleiotropic mutations are important for the origin of these novel traits. Our experiments, which lasted fewer than 250 generations, demonstrate that evolution can readily create an enormous reservoir of latent traits in microbial populations. These traits can facilitate adaptive evolution in a changing world.