If you open Rex's demo project and add this code, you can make the sprite to move in reverse at any time:
You can use this method to change direction. If you need, you can also slow the sprite down by decreasing speed. Say, if the sprite is moving to the right and player is holding Left key, decrease speed until it falls to 0. Then change direction and start increasing speed.