Galaxy flybys can change the structure of galaxies like the Milky Way