I noticed I always google the same procedures…

Remove a file from a commit

Direct remove without editing anything:

git reset HEAD^ -- path/to/file
git commit --amend --no-edit


git reset --soft HEAD~1
git reset HEAD path/to/unwanted_file
git commit -c ORIG_HEAD


Only checkout a subset of files stored in git LFS

GIT_LFS_SKIP_SMUDGE=1 gh repo clone orgname/reponame

Then checkout only specific files:

git lfs fetch --include="pattern*" --exclude=""
git lfs checkout