Remove a file from the last commit
$ git reset --soft HEAD^
Unstage the file that should be removed from the commit:
$ git restore --staged file
$ git commit -m "Message of the commit"
You are done.
Git is copyleft-licensed and was first released in 20051.
- Edit the message of the last commit
- Add a forgotten file to the last commit
- Add newly made modifications to the last commit
$ less /usr/share/doc/git/copyright↩︎