Loading...
git status
git restore --staged config.json
git restore config.json--staged first removes 'config.json' from the staging area, then plain git restore discards its uncommitted edits in the working tree.
git restore . to unstage and losing all uncommitted edits, which cannot be recovered.git restore --staged <file>, which keeps the changes in the working tree.git restore <file> without --staged is used only when losing local changes is intended.--source, e.g. git restore --source=HEAD~1 <file>.git restore only restores files and git switch only changes branches. Both split up jobs that git checkout used to do alone.
Usually not. Unstaged edits discarded by git restore were never stored by Git, so only an editor history or backup can bring them back.