If you accidentally pushed a wrong file to the remote, you can remove the file and the erroneous commit from the history with the following. Identify the last good commit you want to go to and copy its SHA. (Make sure you have no unsaved changes in your local repo as they will be lost.) Then do:
git reset --hard SHA_ID
git push -f
The first command resets HEAD
to the commit SHA_ID
. The second one force pushes the new state to the remote.