Shakeel Mohamed

2014-11-14

Remove an accidentally pushed remote git commit

A quick set of commands for removing a commit once it's been pushed to a remote

git checkout <branch name>
git checkout <commit sha>
git push -f -n # Do a dry run
git push -f # Do the damn thing

Subscribe

Get a friendly note from me, once a month.

I’ll share new blog posts, books I’m reading, life updates, and more!

    Designed and developed with✨emotion✨.