Is it possible to undo a `git add` and go to the exact same staging index as before?

69 views Asked by At

I was trying to split my work into multiple commits. I have done this:

git add --patch my_file
# accepted, rejected, manually edited many hunks
# --->
# now my silly mistake comes
git add my_file
git commit -m "some commit message"

I shouldn't have add that file as my changes are already on the staging index. Can I go back to that state (marked as ---> above)?

0

There are 0 answers