Deformation and evolution of solar wind discontinuities through their interactions with the Earth's bow shock