Skip to content

Instantly share code, notes, and snippets.

@chyld
Last active August 3, 2021 19:07
Show Gist options
  • Save chyld/37c8e38b606292b112cb63564dce2e23 to your computer and use it in GitHub Desktop.
Save chyld/37c8e38b606292b112cb63564dce2e23 to your computer and use it in GitHub Desktop.
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>
git reflog # look at the history of the head pointer
git branch <name> <hash> # starts the branch at a particular hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment