I don't understand why do you ask this question and what exactly you are asking but here's my best effort.
The solutions to these reflections are found by imposing boundary conditions on the wave equations. Imagine a horizontal string and wave propagating to the right on it, which reflects off of a point. You can model all possible waves by a combination of sin and cos functions.
$y_{incoming}(x,t) = Asin(x-vt) + Bcos(x-vt)$
$y_{reflected}(x,t) = Csin(x+vt) + Dcos(x+vt)$
(Change from -vt to +vt reflects the change in direction, and constants A, B, C, D determine the ratios of these terms to one another)
If we say that the string is glued to a point at x = 0, we will get the inversion you talked about. For this to be true, y(0,t) should be 0 at all times. So when you try to come up with an equation for the reflecting wave, you have to impose $y(0,t) = y_{incoming}(0,t) + y_{reflected}(0,t) = 0$ So that the string doesn't move at the connection point x=0.
$y_{incoming}(0,t) = Asin(-vt) + Bcos(-vt)$
$y_{reflected}(0,t) = Csin(-vt) + Dcos(-vt)$
$y(0,t) = (A+C)sin(-vt) + (B+D)cos(-vt)$
Only if C = -A and D = -B, this formula will give 0 for all t values. Basically for any wave solution f(x-vt), the ideal reflection will be -f(x+vt).
For any kind of wave there is, there will be some value that propagates in time and space, pressure, displacement, electric field etc. So, they all can be modeled as "value = f(x-vt)". And when you impose that there is a point $x = x_0$, where the value is always 0, you'll see a similar result for all these kinds of waves.
As you may have realized, I have talked about what got inverted but not about what didn't. 780
That's because there is no need. Waves are basically disturbances of some value that will propagate in a medium as time passes. For example, the displacement for a sound wave which stayed untouched in your example was completely irrelevant in the first place. Sound is not about the displacement of the molecules which mostly stays stationary, it only involves pressure. The vertical displacement was the only value we kept track in our example so everything else stayed untouched, because they weren't involved in the process in the first place.
You may now say that this arguments completely gets crushed once we think about electromagnetic waves. But what's different about the electromagnetic waves is the boundary conditions you have to impose. Charges in a conductor will move around such that it has 0 net electric field on it (since any other configuration will cause the charges to move and therefore not a stable configuration). This means a conductor creates a boundary condition like our previous example. But the magnetic field has no such requirement and acts more like a freely connected string, which as you probably know will cause a reflection but not an inversion. 395