Skip to content

Instantly share code, notes, and snippets.

@timsegraves
Created December 2, 2011 15:51
Show Gist options
  • Save timsegraves/1423711 to your computer and use it in GitHub Desktop.
Save timsegraves/1423711 to your computer and use it in GitHub Desktop.
Git Commands

Git Command Cheat Sheet

Restore a deleted file

This grabs the last version of a file and restores it

git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment