Cheatsheet Pages / Git Cheatsheet
How to unstage a file in Git and keep your edits — git restore --staged
You staged a file by accident and want it out of the next commit without losing the edits.
git restore --staged <file> # unstage, keep edits
Good to know
Removes the file from the staging area; your working-tree changes stay.
