All drones have that ability... it's the basic foundation when it comes to drone systems & how they are managed....Just wondering if DJI drones are designed to right themselves after hitting wires, and continue to fly, if they're not damaged...
Drones use a so called PID controller (proportional integral derivative) & a control loop feedback mechanism to control process variables. The P is the "pusher" which starts the corrective action, D is the "damper" & prevents overshoot & I is kind a long term pusher/damper preventing attitude drift.
The main mission for the PID controller is to make sure the drone do what you command with the sticks... when it comes to "photo drones" with GPS, other commands besides stick moves come in play... GPS for positional hold, barometric sensors for height hold... and code commands coming from stored waypoint missions.
So if the drone suddenly moves or change attitude uncommanded, various sensors will tell the flight controller that the drones deviates from the "setpoint" (sticks, GPS, barometric sensor, code) & will try to command the motors to get back to the "setpoint".
The thing that decides if the drone will "get back on track" is usually either possible damage in the propulsion system or distance to ground/objects as it will take some time to correct a drone that just have hit a guy wire in full speed.