 <p>If you want to delete any commit then you might need to use git rebase command</p> <p>git rebase -i HEAD~2</p> <p>it will show you last 2 commit messages, if you delete the commit message and save that file deleted commit will automatically disappear...</p>