Skip to content

Instantly share code, notes, and snippets.

@olbartek
Created July 6, 2017 20:34
Show Gist options
  • Select an option

  • Save olbartek/362d8938da4efa40be9c2e45c07fde35 to your computer and use it in GitHub Desktop.

Select an option

Save olbartek/362d8938da4efa40be9c2e45c07fde35 to your computer and use it in GitHub Desktop.

Revisions

  1. olbartek created this gist Jul 6, 2017.
    9 changes: 9 additions & 0 deletions git_reflog_simple_usage.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    Have you accidentially made a hard reset to some of your commits?
    git reset --hard HEAD~1

    You can simply check git reflog,
    because Every time the current HEAD gets updated a new entry will be added to the reflog.
    git reflog

    Find the desired commit and make a hard reset to it.
    git reset --hard <commit>