Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (20.3k points)

I wrote the wrong thing in a commit message.

How can I change the message? The commit has not been pushed yet.

1 Answer

0 votes
by (119k points)

You can use the command "git commit --amend' to overwrite the last commit. If you would like to also overwrite the files, you can use the following command:

git commit -a --amend -m "My new commit message"

Also, check out this Git Tutorial to know more.

Browse Categories