Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Removing changes to a file from the previous commit #277
This is what the current README has:
$ git checkout HEAD^ myfile $ git add myfile $ git commit --amend --no-edit
This has the disadvantage of reverting the change entirely.
Another option is to use:
$ git reset HEAD^ myfile $ git commit --amend --no-edit
which is one less command, and preserves the changes to the file in the working tree, while removing it from the commit.