FunctionRacerProblemsRace

Take Back the Commit

MediumGita shell script

The latest commit was made too early. Take it back: the branch ends one commit earlier, and what that commit changed stays in the folder, not staged.

Example 1

starts as
* 614283f (HEAD -> main) too early
* 44553c0 add b
* b527f18 first commit
nothing to commit
ends as
on branch: main
commits, newest first:
  add b
  first commit
staged: nothing
changed, not staged: a.txt
untracked: nothing

Constraints

Race itor take your time

Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.

More Git problems