Nov 05 2019 07:15 AM
Nov 06 2019 01:53 PM
Hello @Descrierx,
I know how working with DevOps and Git can be overwhelming to start. The most important thing is to get your code base back to how it should be. Secondary to that is having a history that reflects this.
Based on your description, I did the similar activity:
So, in my example, I want to get back to the commit 454456cb. There are multiple ways. The recommended way would be to revert the incorrect commits so you are back to 454456cb. This will mean you have the history including the whoops!. Another approach is to reset back to the last good commit.
Let's show both using git bash. First I cloned the repo done to a new folder:
If I use git log then I can see that I have all the commits:
The command to revert multiple commits is: git revert --no-edit -n c7c695fb..c0ea7366
The other approach (and only use if you really want to remove the history) uses a hard reset to the last good changeset:
Going back to my history, you can see everything is now back to how it was:
Hope this helps; if so, please mark as answer.
Cheers,
Jeff