Skip to content

Instantly share code, notes, and snippets.

@Max95Cohen
Created February 14, 2023 08:33
Show Gist options
  • Save Max95Cohen/66fccb64209ca80a2b35ff66d1f97ffa to your computer and use it in GitHub Desktop.
Save Max95Cohen/66fccb64209ca80a2b35ff66d1f97ffa to your computer and use it in GitHub Desktop.
git tips
Local and remote updates
local-pc: git reset --hard HEAD~33
local-pc: git push origin +HEAD:master
remote-pc: git reset --hard HEAD~33
remote-pc: git pull
Reset last push commit
git push -f origin last_known_good_commit:branch_name
Remote all commit and set to current HEAD
git push origin +HEAD^:<branch>
Reset last commits local and remote
git reset --hard <commit>
git checkout -B <branch> origin/<branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment