Git Reset, Revert, and Restore Cheat Sheet/Mental model for reset vs restore vs revert

Quick decision guide for the three similarly named commands.

Section: Decision Guide

Mental model for reset vs restore vs revert

text
text
reset = move branch/history
restore = restore file content/index state
revert = add new commit that undoes old commit
Explanation

Git’s official guidance distinguishes these commands clearly: reset moves refs/history, restore restores files/index, and revert records new inverse commits.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Decision Guide
Use reflog after a mistaken reset
Find the previous branch tip after a bad reset.
OpenIn sheetbashsame section
Create a safety branch before destructive changes
Save a recovery pointer before hard reset or risky history edits.
OpenIn sheetbashsame section
Undo last commit but keep everything staged
Move HEAD back one commit while preserving index and working tree.
OpenIn sheetbash2 tag match
Revert a single commit
Create a new commit that reverses an earlier commit.
OpenIn sheetbash2 tag match
Discard unstaged changes in a file
Restore a file in the working tree from the index.
OpenIn sheetbash2 tag match
Undo last commit and unstage changes
Move HEAD back one commit and leave changes in the working tree.
OpenIn sheetbash2 tag match