Whilst in edit mode simply hit Ctrl + Z to undo your previous action (undo works in object mode as well but for things that you do in edit mode you'll want to undo there). Alternatively, hit "Object" in the bottom left of the 3D Viewport and select Undo.