how to delete git commit?

I want to delete or remove last commit in Git | Git Questions

To remove the last commit from git, you can simply run git reset –hard HEAD^ If you are removing multiple commits from the top, you can run git reset –hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

Deleting commits | How, why and why not | GitHub Tutorial

Leave a Comment

Share via
Copy link
Powered by Social Snap