To remove a commit without changing any source code, you need to perform a “mixed” reset.
Right-click on the last “good” commit (this will probably be origin/master ). Select "Reset current branch for this commit."

In the dialog that appears, select "Mixed ..." from the drop-down list and click "OK."

Your working copy will remain the same (files will not be changed), but the index will be reset, which means that all commits after the selected one will be deleted from your history.
Bj myers
source share