How to delete the last n commits on Github and locally?

To remove the last two commits locally I’d suggest using:

git reset --hard HEAD^^

Rebase is a completely different operation that won’t help you here.

Leave a Comment