Quantcast
Viewing latest article 32
Browse Latest Browse All 80

Answer by Jakub Narębski for How do I delete a commit from a branch?

If you didn't publish changes, to remove latest commit, you can do

$ git reset --hard HEAD^

(note that this would also remove all uncommitted changes; use with care).

If you already published to-be-deleted commit, use git revert

$ git revert HEAD

Viewing latest article 32
Browse Latest Browse All 80

Trending Articles