0

I needed to revert my commit that was merged into mainline due to a failed test. I used git revert commitID to revert my changes. But now all the changes made are also gone from my local, how do I get the changes back locally so I can modify it and send out a new Code Review?

  • `git revert` created a new commit (probably it is still HEAD). Go to the commit before it with `git checkout HEAD~1` – William Pursell Feb 23 '23 at 23:55
  • @WilliamPursell that worked, but now when I do ```git status``` I don't see the files that I had changed previously, so if I do make new changes and want to raise a new Code review, how would I obtain all the files that I have changed? – user3927038 Feb 24 '23 at 00:08
  • To see a status of your files with respect to the previous commit: try `git diff --name-status HEAD~`. To view the diff of a specific file: `git diff HEAD~ -- that/specific/file`. You can also try: `git difftool -d HEAD~`. – LeGEC Feb 24 '23 at 07:53

0 Answers0