Skip to content

Instantly share code, notes, and snippets.

@cowlinator
Last active October 3, 2017 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowlinator/c382e461db1c168d56a7af715e0b08f2 to your computer and use it in GitHub Desktop.
Save cowlinator/c382e461db1c168d56a7af715e0b08f2 to your computer and use it in GitHub Desktop.
Useful git commands
git checkout -- . DISCARD non-staged changes
git clean -d -f DISCARD untracked files
git cherry-pick --no-commit $SHA Cherry-pick to staging area
git revert --no-commit $SHA Revert to staging area
git push -f FORCE push
git reset --hard @{u} RESET HARD to upstream-branch
git branch --unset-upstream Track Remote: None (for current branch)
git branch --set-upstream-to=$REMOTE_BRANCH Track Remote (for current branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment