If robots are ever to achieve autonomous motion comparable to that exhibited by animals, they must acquire the ability to quickly recover motor behaviors when damage, malfunction, or environmental conditions compromise their ability to move effectively. We present an approach which allowed our robots and simulated robots to recover high-degree of freedom motor behaviors within a few dozen attempts. % Our approach employs a behavior specification expressing the desired behaviors in terms as rank ordered differential constraints. We show how factoring these constraints through an encoding templates produces a recipe for generalizing a previously optimized behavior to new circumstances in a form amenable to rapid learning. We further illustrate that adequate constraints are generically easy to determine in data-driven contexts. As illustration, we demonstrate our recovery approach on a physical 7 DOF hexapod robot, as well as a simulation of a 6 DOF 2D kinematic mechanism. In both cases we recovered a behavior functionally indistinguishable from the previously optimized motion.