I commited a file that's over github's file size limit. How do fix this commit without losing progress?

Viewed 22

I was working on a project and commited all changes to my local branch. When I tried to push to github I got denied because one of the new files created on my repo was over the default filesize limit. Now even if I remove the offending file and do a new commit I can't push to the repo, since a version of that file is on my branch history.

How can I remove this file from the existing commit without losing all changes done to other files?

I'm thinking of branching the previous commit, merging both except for the new file, but I'm not experienced enough to do it with confidence, so if anyone is willing to write out a step by step I'd appreciate it.

Thanks!

1 Answers

the command git reset --soft resets the commit history to the last commit without changing or deleting files in the working directory. From there, just recommit all the files you want to have in the commit.

Related