Inductive flyback in depth An inductor fundamentally, opposes sudden current change (ΔI/Δt) and its behavior is governed by induction law:
V = L*dI/Dt
Opening the switch breaks the circuit path via a sudden change, forcing the current to drop from a steady state down to 0 roughly instantly (Δt = 0). As Δt is near 0, as the denominator, the derivative dI/Dt becomes a high negative value.
With the inductor coil's field collapsed the energy stored is released. This cuts across the inductor's wire turns, converting the stored magnetic energy back to electric energy.
After this, by nature, the inductor forces current to flow in the original direction by briefly works as a power source by flipping its voltage polarity. This governed by Lenz’s Law, stating an induced electromotive force (voltage) always oppose the magnetic flux change that produced it.