Dear Minisan,
with full bridge drive it can achived.
suppose a full bridge ciruit which use battery for power supply.
any time average voltage feeded to motor is lower than motor voltage, i mean motor rotate with higher speed, regenaration start.
This phenomena is like step-up swithing regulator.
its component are (internal) motor self inductance and 4 diodes (paralleled with 4 transistors switch).
returned motor energy going to charge battery.
Note: for regeneration purpose (one leg of) PWM must on full time,
even for ≈0V output voltage.
Other leg must set to high or low, depend on rotation direction.
Regards,
Davood.