Git Is the Real Undo

What changed?

cd ~/.config/nvim
git diff
git log --oneline -10

If it worked yesterday and not today, the diff is the bug.

Going back

git checkout -- lua/plugins/lsp.lua    # one file
git stash                              # everything, keep it for later
git checkout <commit>                  # the whole config, as it was

Plugin versions

:Lazy restore

restores every plugin to the commits in lazy-lock.json. Combined with git checkout lazy-lock.json, that returns you to a known-good editor even when the breakage came from someone else’s update.

This is why putting the config in git matters more than any single plugin.