Git: Remove a file from the last commit
Run:
$ git reset --soft HEAD^
Unstage the file that should be removed from the commit:
$ git restore --staged file
Commit again:
$ git commit -m "Message of the commit"
You are done.
Git is copyleft-licensed and was first released in 20051.
See also:
- 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↩︎
personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki git