One of the 100 questions in this topic
The git rm --cached command removes a file from the index while keeping its local copy.