You committed inside a submodule, ran `git submodule update`, and your commits vanished.
IntermediateTroubleshootingSubmodules, LFS and Hooks
Answer
Likely causes → Submodules are checked out in detached HEAD at the commit the parent records. Your commits were made on that detached HEAD, and submodule update moved HEAD back to the recorded commit, leaving yours unreferenced.
Diagnose → git -C libs/common reflog -10 shows your commits.
Fix →
cd libs/common
git branch rescue <sha-from-reflog>
git switch main && git merge rescue && git push origin main
cd .. && git add libs/common && git commit -m "Bump common"
Prevent → Always git switch <branch> inside a submodule before committing, or use git submodule update --remote --merge to work on a branch.
More on Submodules, LFS and Hooks
`fatal: No url found for submodule path 'libs/common' in .gitmodules`IntermediateAfter cloning, the submodule directories exist but are empty.Beginner`git submodule update` fails: `fatal: remote error: upload-pack: not our ref 3f2a9c1...` and `Fetched in submodule path 'libs/common', but it did not contain 3f2a9c1. Direct fetching of that commit failed.`Intermediate`git status` keeps showing `modified: libs/common (new commits)` even though you never touched it.Beginner`git submodule add` fails with `fatal: 'libs/common' already exists in the index`.IntermediateRe-adding a removed submodule fails: `A git directory for 'libs/common' is found locally with remote(s): origin https://github.com/org/common.git`.Advanced