Skip to content

Instantly share code, notes, and snippets.

@isabellachen
Last active October 10, 2017 13:40
Show Gist options
  • Save isabellachen/24f63a1ac759caf6ab0cf318b7de1a17 to your computer and use it in GitHub Desktop.
Save isabellachen/24f63a1ac759caf6ab0cf318b7de1a17 to your computer and use it in GitHub Desktop.
Checkout out a previous commit and returning to uncommitted changes from HEAD
$ git stash //stash uncommited changes
$ git log //look at your changes and choose the commit you want
$ git checkout <e2g> //where e2g is the commit no.
$ git checkout HEAD //go back to the latest commit
$ git stash pop //pop your uncommited changes 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment