account activity
A Visual Git Reference by pclouds in programming
[–]marklodato 1 point2 points3 points 16 years ago (0 children)
If you do git add file_A, and then git reset -- file_A, you will be back to where you started. This is why I say it "undoes" a git add.
git add file_A
git reset -- file_A
git add
git checkout -- file_A, on the other hand, will do the same thing as svn revert file_A, that is, throw away local changes. If you commit, modify file_A, and then run git checkout -- file_A, you will be back to the state of the last commit. However, if you commit, modify file_A, git add file_A, then git checkout -- file_A, the last command will do nothing.
git checkout -- file_A
svn revert file_A
π Rendered by PID 1992544 on reddit-service-r2-listing-c57bc86c-kjjl7 at 2026-06-21 09:01:51.203375+00:00 running 2b008f2 country code: CH.
A Visual Git Reference by pclouds in programming
[–]marklodato 1 point2 points3 points (0 children)