Overview Choose an undo command by identifying what must be kept: staging state, working files, commit history, or the physical file itself. Reset, restore, rm, and revert solve different problems and are not interchangeable.