This tutorial shows you that how you can undo your last commit using CMD and this tutorial also teaches you some basic concepts of git
Following screenshot shows that how you can commit using CMD in git
git status
git add file.php
git reset
git add file.php
git commit -c ORIG_HEAD
This will open an editor, which initially contains the old message from the old commit to edit this message please press - and ctrl
button at the same time
After editing your desired message after that please follow the following steps
esc
:wq
Final step is to just push changes to git using cmd git push
Final commands are here
git commit -m "Something weired happened"
git reset HEAD~
git add file.php
git commit -c ORIG_HEAD