I accidentally committed a large file to my local git. The file is too big to be added to the remote repository which makes it impossible to push my code at the moment. The problem is, that I didn't notice how big the file was getting for quite a while so I happily added some commits on top of it. Now, 4-5 commits later I need to get rid of this file in the previous commits so that I can push my code to the remote repository.
Naturally, I am very scared to delete half my code :-D
Is there any risk free way to achieve this?