for short invincibility for the player after he gets hit, put the events (for the hit and damage) inside a group, and on hit, disable that group for like 2 seconds or whatever you want then enable it again
for jumping back, like the guys said, set the vector x to + or - depending on which side the enemy is on. to determine which side of the player the enemy is on, you can create an event condition like:
if Player.X < Enemy.X (for player on the left)
--> set Player vector x to -300 or something
if Player.X > Enemy.Y (for player on the right)
--> set Player vector x to 300 or something
hope that helps :)