Skip to content

Instantly share code, notes, and snippets.

@catm705
Last active August 29, 2015 14:23
Show Gist options
  • Save catm705/643a4a099e3aa75dc27d to your computer and use it in GitHub Desktop.
Save catm705/643a4a099e3aa75dc27d to your computer and use it in GitHub Desktop.
Collapsing git commits & Stashing
___ COLLAPSING COMMITS ___
1. git reset HEAD~ or git reset hEAD@{3}
2. git push -f origin feature/url-ingestion
** Don't do this often and only with permission - it rewrites github's history.
___ STASHING ___
git stash show -p stash@{0} --> This one will show you the differences in code from one stash to the other. The # indicates which.
git stash apply stash@{0} --> This is bring back the stash you choose according to the number you put in the curly braces.
git reset HEAD~ --> This will undo your last commit (only do this if you haven't git pushed it yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment