Correcting course

Chapter 5 of 5 · 6 lessons

A correction starts with a choice: keep the recorded history and add a correction, or move a private branch to a different point? For an uncommitted edit, neither is necessary. This chapter assumes familiarity with commits, branches, staging and merging.

  1. Locate the change — inspect and choose a safe direction.
  2. Correct an uncommitted file — unstage or intentionally discard a file edit.
  3. Reverse a recorded change — add a correction without rewriting shared history.
  4. Move a private branch — compare reset modes and their consequences.
  5. Find a previous tip — use a local reflog, with limits.
  6. Replay private work — rebase, conflicts and shared history.

Examples describe local operations in a disposable repository, not a production project. Before any potentially destructive operation, preserve work you need independently and inspect the destination. A backup branch saves committed history only.

Continue to the final assessment.