Skip to content

Instantly share code, notes, and snippets.

@matteobaccan
Last active October 26, 2021 07:55
Show Gist options
  • Save matteobaccan/06a64b26172f1d28919f8af255e791b7 to your computer and use it in GitHub Desktop.
Save matteobaccan/06a64b26172f1d28919f8af255e791b7 to your computer and use it in GitHub Desktop.
Remove remote commit
For remove remote push/commit you can simply use this command
git push -f origin <last_known_good_commit>:<branch_name>
for example if you need to remove last commit in origin\master
git push -f origin f07c605:master
where f07c605 is the commit id of your last good commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment