git rm filename
git rm --cached filename
git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD
(from Stack Overflow)
To delete the last commit:
git reset --hard HEAD~1
To delete a different past commit:
git reset --hard <sha1-commit-id>
See this Stackoverflow thread for more details.