Sometimes you found that you have committed some wrong files for in-completed code in your local git repository. The following command will revert last commit in your current working repository. If you just want to change last commit message, you can use this article to do it.
Undo the Last Commit:-
$ git reset --soft HEAD~
In above command HEAD is a reference to the last commit in the current checked out branch.
Commit Files Again:-
Now edit your files and make necessary changes and add them again using git add command. After that commit files as you do always but you can reuse the old commit message using -c ORIG_HEAD. This will open last commit message in editor.
$ git add ... $ git commit -c ORIG_HEAD