I have a file on which I have made several uncommited modifications.
git diff somefile
a
b
+Added line
c
d
-Removed line
f
How can I discard only some of these changes (say the removed line)?
git checkout somefile
will discard all changes, and I would like a mechanism similar to git add -p
that lets me select which hunks to keep and which hunks to discard.