Practice this fail.
A little less committed.
Git · Restart as often as you like
Read the error, choose a command, and learn
why it works. Nothing runs on your machine.
This repository already has commits. src/config.js is tracked, and you accidentally staged its latest edits. Keep those edits on disk.
A little less committed.
$ git status --short
M src/config.js
Right changes. Wrong commit.
How do you remove this file’s edits from the next commit without losing them?
Fixed. By hand.
git restore --staged -- src/config.jsWith --staged, git restore updates only the staging area. Its default source in this mode is HEAD, so the file’s staged changes are removed while its working-tree edits remain on disk. The repository-has-commits assumption matters because HEAD must exist.
Practice does not affect your daily score or streak.