Can you change pokemons during a Gym Battle?

If the second pokemon in a Gym is Super effective against me, can I change pokemons or do I have to die as much times as it takes for me to get to a pokemon that will defeat or be super effective against the pokemon in the gym?


You can. Just type the button in the bottom right during a fight:

poke_gym_fight