A diverted flight is one that has been routed from its scheduled arrival destination to a new, typically temporary, arrival destination. The leg of the flight that is routed back to the scheduled arrival destination is called the recovery leg.
When you are viewing flight information for a diverted flight, you will see the diversion leg. The recovery leg will be displayed only if available.