The "magic" of course, is AC...
As a visualization, the hydraulic ram pump[1] is the water equivalent of a DC boost converter[2]. At no point in the cycle does the water flow in reverse. Same with the DC boost converter.
It is true that in most cases the inductor current isn't changing direction though.
Any AC inside the circuit is due to imperfections, like the reverse recovery time of the diodes or similar.