FunctionRacerProblemsRace

Undo With a New Commit

MediumGita shell script

The latest commit broke something. Others already have it, so the history has to stay as it is. Make a new commit that undoes what it changed, with the message Git suggests.

Example 1

starts as
* e2bb074 (HEAD -> main) change a
* 44553c0 add b
* b527f18 first commit
nothing to commit
ends as
commits, newest first:
  Revert "change a"
  change a
  add b
  first commit
staged: nothing
changed, not staged: nothing
untracked: nothing
a.txt:
  1
b.txt:
  2

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