When I am splitting a commit during interactive rebase, I often would like to extract specific files from the last commit.
My current process is to
I feel like this would be simpler if I could soft reset a specific file.
Are you trying to do git checkout $COMMIT_HASH some_file.ext
?
You can use this to revert a file to its previous state, and git stages this change.
It seems this does what you want :
git reset [-q] [commit] [--] paths…
This form resets the index entries for allpaths
to their state atcommit
. (It does not affect the working tree, nor the current branch.)This means that git reset is the opposite of git add .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With