Let's Draw a Line
Now that the line is on the canvas we want to remove it
These buttons are the "Interface Express buttons", easy to access for Undo and Redo
Finally the last way of doing it is by shortcut: Ctrl(or CMD) + Z to Undo /CTRL(or CMD) + Y to Redo
6 steps complete