506 B
506 B
title, tags
| title | tags |
|---|---|
| Remove a file from the last commit | commit,intermediate |
Removes a file from the last commit without changing its message.
- Use
git rm —-cached <file>to remove the specified<file>from the index. - Use
git commit —-amendto update the contents of the last commit, without changing its message.
git rm —-cached <file>
git commit —-amend
git rm —-cached "30-seconds.txt"
git commit —-amend
# Removes `30-seconds.txt` from the last commit