How do I edit an incorrect commit message in Git?

To change the commit message git commit –amend -m “New commit message” Used to amend the tip of the current branch. Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create … Continue reading How do I edit an incorrect commit message in Git?

How to undo the last Git commit?

Undoing a commit seems little difficult if you don’t know how to do it. But it’s actually pretty simple, here is simple commands for Undo a commit and redo $ git commit –┬áThis is what you want to undo $ git reset –soft HEAD^ –┬áThis is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or … Continue reading How to undo the last Git commit?