How SpaceX saved the Dragon capsule from destruction

On March 1, SpaceX ran a test launch of Dragon, the capsule in which it hopes to someday transport human beings into space. Dragon was due to connect with the International Space Station, but very quickly into the launch things started to go all wrong. This is a short summary of the SpaceX team managed to stop their capsule from tumbling out of control.