# Changing a commit message with Git

[`🇻🇪 Spanish`](https://crisprogramando.hashnode.dev/modificar-un-mensaje-de-commit-con-git)

1.- If you wrote a commit message incorrectly and pushed it, you can change this message immediately using `git commit --amend` command, this command open a text editor to change the message. For exit press `ESC + Shift + :` and write `:wq` to save changes.

```jsx
git commit --amend
```

2.- Force `push` with command:

```jsx
git push origin main -f
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678892694834/91093afc-2890-4cef-ad70-ea753422962e.png align="center")

3.- Use `git log` command to see historical changes.

```jsx
git log
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678892736969/4cf406f1-3b8a-4b6e-bc85-99126ff544a0.png align="center")

### **Reference:**

[**https://git-scm.com/book/es/v2**](https://git-scm.com/book/es/v2)
