I accidentally added some large files into my git commit. After this I have deleted the large files and now I want to commit the remaining changes (excluding the large files) but somehow the deletion of the large files are still in my git history and therefore I cannot make any further commits. I do not want to git reset HARD or something and lose a lot of my local changes. How do I resolve this?
My steps:
git add -A
git commit -m "Commiting with Large Files"
git push origin main
-- Failed to push due to Large files
Now I delete these large files from my local machine and try to push again
git add -A
git commit -m "Commiting with deleted large files"
git push origin main
-- Failed to push
I tried
git reset --soft HEAD~1
git reset
but I still have the deleted files as unstaged changes which is preventing from a new git add -A and push.
Unstaged changes after reset:
D largefile/b_qty.tar.gz
D largefile/b_qty.txt
D largefile/s_qty.tar.gz
D largefile/s_qty.txt
Any suggestions on how to fix this? I really cannot lose any of my local changes.