Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (29.3k points)

I accidentally committed to the wrong branch. How do I delete that commit?

1 Answer

0 votes
by (50.2k points)

Use this command to delete all your work and unpushed git commits use 

git reset --hard HEAD~1

And there is one more option --soft which will delete the recent commit and it doesn’t do anything to your work.


Browse Categories