I wanted to go to a certain stage of my commit. I git revert 3a3a32
that commit but actually wanted to go back. How do I go back to that commit, after undoing the revert?
Asked
Active
Viewed 1,875 times
0

jonrsharpe
- 115,751
- 26
- 228
- 437

Md Antor
- 3
- 3
-
Do you mean `git reset --hard`? – matt May 09 '22 at 17:03
-
1@matt Please don't suggest reset without knowing A LOT more about the issue at hand. It is the main reason we have repeat questions here along the lines of "halp, I lost all my commits". – Lasse V. Karlsen May 09 '22 at 17:04
-
Do you have additional commits after the revert, with changes you want to keep – Lasse V. Karlsen May 09 '22 at 17:05
-
You can revert a reversion commit. It's just another commit, really. – isherwood May 09 '22 at 17:16
-
1Does this answer your question? [How do I "un-revert" a reverted Git commit?](https://stackoverflow.com/questions/8728093/how-do-i-un-revert-a-reverted-git-commit) – isherwood May 09 '22 at 17:19
-
Love you guys all !! this is my first question asked.. People here are very helpful, I thought won't get help for may be days. @isherwood, no brother, not exactly that ans. after 'revert' i commited few times but didn't push. then reverte the revert commit. I exactly want undo all the mess and go back to the last that commit before reverting it. – Md Antor May 09 '22 at 17:37
-
1Does this answer your question? [How do I revert a Git repository to a previous commit?](https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit) – isherwood May 09 '22 at 17:39
-
@LasseV.Karlsen I agree of course, but I suspect that `git reset --hard` is exactly what the OP wants. I will of course remove the comment if I'm mistaken. – matt May 09 '22 at 18:03
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 09 '22 at 18:18
1 Answers
1
check git reflog
command.
It displays list of your latest changes. Find position before your git revert
and do git checkout HEAD@{x}
where x
is position returned from git reflog

psstepniewski
- 46
- 4