How do I undo the most recent local commits in Git?

Git

Recently accidentally committed the wrong files to Git, but didn’t push the commit to the server yet. Then I wanted to undo those commits from the local repository, So In this article, I’m going to share with you how to do that.

Steps to undo the most recent local commits

$ git reset HEAD~                              #