If you make a keyframe then you can immediately use Ctrl+Z to Undo that action. For some reason I’m not sure of, it often needs two presses of Ctrl+Z.
If you notice later, so that you can’t use Ctrl+Z, then you can right-click on it and select Remove Keyframe, or Remove Frame and Pull which will pull any future frames back by 1 frame along the timeline.
When a layer has become animated, you can’t make it a non-animated static layer after that. So you may need to delete that accidentally animated layer then make a new paint layer to replace it.