Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shravankb/e1ee62dd545eb473bf61bffe6fd79e55 to your computer and use it in GitHub Desktop.

Select an option

Save shravankb/e1ee62dd545eb473bf61bffe6fd79e55 to your computer and use it in GitHub Desktop.

Revisions

  1. @chyld chyld revised this gist Sep 10, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -4,3 +4,5 @@ git restore .
    git commit --amend -m "change last commit"
    git revert <commit hash> # creates a new commit at head that undoes a previous commit
    get reset --hard --soft --mixed <hash>
    git reflog # look at the history of the head pointer
    git branch <name> <hash> # starts the branch at a particular hash
  2. @chyld chyld created this gist Sep 9, 2020.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    git restore filename
    git restore -p filename (patch level)
    git restore .
    git commit --amend -m "change last commit"
    git revert <commit hash> # creates a new commit at head that undoes a previous commit
    get reset --hard --soft --mixed <hash>