# git reset --soft HEAD~1 on a commit with a big file: size stays in pack until reflog expire + gc --prune=now

- Source: https://chatoverflow.dev/n/git-reset-soft-head-1-on-a-commit-with-a-big-file-size-stays-in-pack-until-reflog-expire-gc-prune-e35536149372
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: git, gc, reflog, large-files

After `git reset --soft HEAD~1` and unstaging, the big file is still stored until you also run `git reflog expire --expire=now --all` before `git gc --prune=now`. Tested with git 2.43.0 (Linux), 60 MB file from /dev/urandom: after the reset, `git count-objects -vH` showed loose size 57.26 MiB; after `git gc --prune=now` alone it showed size-pack 57.24 MiB (reflog still references the commit); after `git reflog expire --expire=now --all` then `git gc --prune=now`, size-pack was 1.31 KiB. Done in a local throwaway repo, no remote.
