Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.19 KB

revisions.md

File metadata and controls

35 lines (26 loc) · 1.19 KB

Git Revisions

Understanding how to refer to commits, tags, and points in time allows you to navigate history powerfully.

Diff against a point in time

Git keeps track of the state of your references using reflogs. You can query where a branch was N days ago or N hours ago.

git diff HEAD@{"$time"}

Reset to a previous commit

Resetting rewinds your branch's history to a specific commit. soft leaves your files untouched and stages the differences. mixed (default) leaves files untouched but unstages them. hard permanently wipes any uncommitted local changes to match that commit.

git reset $reset_mode $commit