"Roll" Is stuck going to the right direction only

Hello, I am making a 2d pixel art action inspired by games like deadcells and wizard of legend. I am trying make a roll, but is only moving in the right direction. I need for it to move backwards AND forwards. This is my current code based off of some prior research. Any Ideas?