I accidentaly committed some very large PDF files that were well over GitHub's size limit, so when I later pushed, I got an error, and wasn't able to push. Now, I want to remove those files from the commit, without losing them locally, so that I can later add .pdf in .gitignore
and commit and push my other changes. Does anyone know how I can do this?
I do not want to undo any changes, or risk to do that.
Open terminal, cd
to your git directory and
git log
You will see something like this:
Then copy the commit hash before the addition of these large pdf files and run this command
git reset --soft <good commit hash>
now you can push your local changes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With