Skip to content

Instantly share code, notes, and snippets.

View sjkim04's full-sized avatar

sjk sjkim04

View GitHub Profile
Question:
I have to delete 2 last commits pushed to original repo, one of which is a merge commit. I want to delete changes in repo and keep them on my computer.
When I do
git revert -m 1 075cc2f
It adds a revert commit to my history of commits and my 075cc2f commit is still present there.
When I do
git push origin +HEAD^:master
commit is fully deleted from history.