I just did a commit:
git commit -m "este es un comentario"
However, I have suddenly realized that this message is not correct. Can I modify it? If yes, how?
If I write again git commit -m "un nuevo comentario"
it will make another commit instead of modifying the one I already did.
The most practical and fastest option is to use:
After which the editor will open so you can modify the message.
If you want to write something totally new, you can say directly:
You can see more details in the English version answer to Edit an incorrect commit message in Git .
You can also edit the commit history to modify more than one message, using git rebase
This will open a text editor (vim) where you can update the commit history messages.