How to Remove a File From Git Commit
- 1). Open a command line program and navigate to the folder where the commit change was made. For example, "cd /var/httpd" would open the "httpd" folder in the "var" directory.
- 2). Type "git revert HEAD" where "HEAD" is the main branch before the faulty commit.
- 3). Type "git commit CHANGE" where "CHANGE" is the corrected file that should have been committed earlier.
Source...