To undo the previous line segment, enter u at the prompt. Click Undo on the Quick Access toolbar to cancel the entire series of line segments: