References: Undoing things
Primary sources
Section titled “Primary sources”Pro Git by Scott Chacon and Ben Straub. Chapter 2 section 2.4 (Undoing Things) and Chapter 7 section 7.7 (Reset Demystified). Licensed under Creative Commons Attribution Non Commercial Share Alike 3.0 Unported.
Read the sources online at git-scm.com/book/en/v2/Git-Basics-Undoing-Things and git-scm.com/book/en/v2/Git-Tools-Reset-Demystified.
Pro Git's "Reset Demystified" chapter is widely considered the clearest explanation of git reset's three modes. L4's reset framing is informed by it.
Secondary sources
Section titled “Secondary sources”Atlassian Git Tutorials, specifically the "Undoing Commits & Changes" section at atlassian.com/git/tutorials/undoing-changes. Licensed under Creative Commons Attribution 2.5 Australia.
The Atlassian framing is a useful second voice for the reset vs revert distinction; some learners click with one explanation more than another.
Git documentation on git reflog at git-scm.com/docs/git-reflog. The authoritative reference. Includes the syntax for reflog references like HEAD@{N}. The retention defaults live in the gc.reflogExpire setting (90 days) and the gc.reflogExpireUnreachable setting (30 days for entries not reachable from the current tip, which is what a hard reset leaves behind).
Further reading
Section titled “Further reading”For a deeper understanding of git's data model (which makes all of these commands more intuitive): Pro Git Chapter 10 (Git Internals) covers how commits, trees, and blobs are actually structured. Reading it changes how you think about every other command.
For recovering force-pushed remote history: the "Recovering from upstream rebase" section of the git-rebase documentation covers the scenario where someone else rewrote and force-pushed a branch you built on. Beyond this lesson's scope; mentioned for completeness.
For interactive rebase to clean up commits before push: Pro Git Chapter 7 section 7.6 (Rewriting History). We cover this in L12. The Pro Git reference is the canonical source.
What this lesson does not cite
Section titled “What this lesson does not cite”Lesson 4 does not yet cite GitHub, GitLab, or Bitbucket's web UIs for undo operations. The hosting platforms expose limited undo features (revert a PR, revert a merge); we cover these when introducing Pull Requests in L6.
License of this lesson
Section titled “License of this lesson”This lesson is part of the Clawdemy curriculum, licensed under Creative Commons Attribution NonCommercial Share Alike 4.0 International. Pro Git's CC BY-NC-SA 3.0 license and Clawdemy's CC BY-NC-SA 4.0 license are directly aligned (the 4.0 license is an approved compatible adaptation license for 3.0 source material per the 3.0 license's later-versions provision). Commercial use is licensed separately at /legal/licensing.