Undo changes
git restore <file> sync the working tree with the staging tree
git restore <file>
Undo staging
git restore --staged <file> remove the file from the staging tree
git restore --staged <file>
Undo commit
git revert <c1> revert to a previous commit c1 as a new commit
git revert <c1>
c1
Last updated 2 years ago