Buy a motor controller that has built in regenerative braking capabilities.
I was very involved with the solar car team in college. The EE's designed and built a solar charge controller/battery management system (BMS) for the battery pack. It didn't work. We ended up with a complicated device that didn't work that only a few people understood well enough...(more)