THE CODE TIME TRAVELLER

Try this lesson

Git & GitHub · 4 minutes · no sign-up

Trial · 1/7

4 min

Recover the deleted commit

Briefing

Nothing is gone until GC

HEAD moved. The commit still has a hash. Reflog is the time machine.

  • reset moves a pointer; it does not immediately shred objects
  • reflog lists where HEAD has been
  • force-push is how you make the mistake public