Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...