I was working on a branch and by accident I've done git reset HEAD~1
because I thought I'm resetting my last commit.
The problem is that I didn't even commit my changes so I've done reset to commit which was done by someone else. A lot of changes in that commit were done on files on which I was also working on so I didn't notice and continued my work. After I've committed and pushed my changes, I've noticed missing commit.
develop branch: commitA -> commitB -> commitC
my branch: commitA -> commitB -> myCommit
Is there any way to revert those changes and insert commitC
before my commit?
git commit -a -s -c ORIG_HEAD
, but it will not include added files, you have to rungit add ...<list of files>...
beforehand.