Jul 112013
Rewriting last Git commit
Answer:
Sometimes, when you regret your last commit and before it is pushed to remote, it is easy with the following commands:
git add file1.txt file2.txt
git commit -m 'Add some files'
# Now you regret to include file2.txt
git rm file2.txt
git commit --amend # Edit the commit message in the editor