how to rollback in git to yesterday or to the log I need, the problem is that I didn’t do the commit, it is there but it is too old changes. I have a main branch on a remote repository main: develop and a branch from it also on the correction-testing repository.
I can recreate step by step the commands I made:
I stood on my correction-testing branch I had a lot of changes, entered the command git add . then git stash.
Then I went to the dev branch and entered git pull.
Then I went to my correction-testing branch and started entering commands:
git commit -m
git rebase develop and a lot of conflicts appeared, conflicts were fixed, but still could not achieve success.
Later I decided to rollback with git reflog, but still new changes from dev are present.
Please help me to roll back, not to commit, but to the moment when I haven’t implemented git pull on the dev branch yet.
Attached is the reflog:
c191a2d6 HEAD@{14}: rebase (continue): intermediate test results
271164a5 HEAD@{15}: rebase (continue): intermediate test results
c639d2d5 HEAD@{16}: rebase (continue): intermediate test results
5e661014 HEAD@{17}: rebase (continue): intermediate test results
213499fa (tag: v2.0.12, origin/develop, origin/HEAD, develop) HEAD@{18}: rebase (start): checkout develop
dbb76d86 HEAD@{19}: commit: intermediate test results
1d76f4e6 HEAD@{20}: reset: moving to HEAD~1
d272ab5a HEAD@{21}: commit: intermediate test results
1d76f4e6 HEAD@{22}: checkout: moving from development to correction-testing
213499fa (tag: v2.0.12, origin/develop, origin/HEAD, develop) HEAD@{23}: pull: Fast-forward
7fee5206 (tag: v2.0.0) HEAD@{24}: checkout: moving from correction-testing to develop
1d76f4e6 HEAD@{25}: reset: moving to HEAD
1d76f4e6 HEAD@{26}: checkout: moving from 7fee5206d0968809b95b72746ab661d30c2f759f to correction-testing
7fee5206 (tag: v2.0.0) HEAD@{27}: rebase (start): checkout develop.
I think I need to get into this state:
7fee5206 (tag: v2.0.0) HEAD@{24}: checkout: moving from correction-testing to develop
PS : already used the commands to rollback git reset –hard 7fee5206
I’m expecting to roll back to a state where I haven’t done a git pull yet.
Grigoryi Evdakov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.