Resilience of traffic networks: from perturbation to recovery via a dynamic restricted equilibrium model