Remove files from Git commit

Ask a question+
0

I am using Git and I have committed few files using

git commit -a

Later, I found that a file had mistakenly been added to the commit.
How can I remove a file from the last commit?

add comment

1 Answer

0

git reset —soft HEAD^
or
Then reset the unwanted files in order to leave them out from the commit:

git reset HEAD path/to/unwanted_file

add comment

Your Answer