animation-direction: alternate-reverse

The animation plays backwards first, then forwards: