How to Move my Pawn up on z axis on key press and return to its previous location on release

The plank should go up on pressing a key and return to its previous position on release.
The plank is movable in fwd/rwd left and right direction as well. I did the movements. only this moving on z is not working for me