well, just like X2I said, you can use the code you used for jumping.
an example:
if you usedX2I's code to make your guy jump, here's how he did it:
then add the code for the ground he had.
now, when you press UP, your character jumps.
NOW here's how we can use it to make the enemy fly back.
now, as we see, I took the code to make the character jump and added makeing him move left to make him get knocked back whe hit by your attack. try it out and tell me if there is a problem.