How Can I Return the Player to the Previous Tile?

I'm not even sure what this would be called to accurately search for it, so apologies in advance if this is already answered, but I'm trying to create a pitfall where the player falls into a pit, sustains some damage, then reappears on the last viable tile they were on before falling into the pit - i.e. 16 bit Zelda.

Assuming the player could fall into any given hole from any potential angle, is there a way to move the player back to the spot they were on before stepping into the pit?
Would a transfer not work? Or are you looking for something more specific? (Like if the player enters from the right, they'd fall, and reappear on the right wherever you'd want them to.)
Hmmm, doesn't your facing direction tell you what direction you stepped onto the pit from. Just transfer the player on a tile next to the pit depending on what direction they're facing when on top of the pit (with the conditionals 'if player is facing XXXX').

EDIT: You can take the pits coordinates into variables with control variables and then add/subtract to them depending on the facing direction and then transfer player to the coordinates.
Wouldn't the viewing direction of the player always be the opposite of the direction you want them to move back?

So, you get their coordinates as soon as they step on a trap.
If facing Up, set y+1, if facing down, y-1. If facing right x-1 and left x+1.

And then teleport them back to that position with Fade none and retain direction.
Thank you all. @Zia_ I think that will work best.
You can just use "set movement route" and "1 step backward"?

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-return-the-player-to-the-previous-tile.174241/