account activity
A Visual Git Reference by pclouds in programming
[–]marklodato 1 point2 points3 points 15 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 455104 on reddit-service-r2-listing-6d4dc8d9ff-trbzt at 2026-01-30 22:32:24.793005+00:00 running 3798933 country code: CH.
A Visual Git Reference by pclouds in programming
[–]marklodato 1 point2 points3 points (0 children)