A reversible switch of a cell from one phenotype to another that occurs upon infection of a host or host cell. For example, Candida albicans switches from a unicellular form to an invasive multicellular filamentous form upon infection of host tissue. Phenotypic switching begins with changes in cell morphology and altered gene expression patterns and ends when the morphology of a population of cells has reverted back to the default state, accompanied by altered expression patterns.