Run the following command to revert the last commit.
$ git reset --soft HEAD~
Note: You can specify multiple commits by placing a number at the end.
For instance, if we want to undo the last two commits,
we can run the following command.
$ git reset --soft HEAD~2