> For the complete documentation index, see [llms.txt](https://sagar-r-kothari.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sagar-r-kothari.gitbook.io/blog/_posts/2020-02-19-undolastcommit.md).

# 2020-02-19-UndoLastCommit

```
$ git commit -m "Something terribly misguided"             # (1)
$ git reset HEAD~                                          # (2)
<< edit files as necessary >>                              # (3)
$ git add ...                                              # (4)
$ git commit -c ORIG_HEAD                                  # (5)
```

1. Your last commit
2. Sencond step above, illustrates how to move your git-head one commit back.
3. Make changes - Remove changes which you didn't want.
4. Add your new changes.
5. Commit those changes ✅👍 - You're all set.
