https://github.com/blog/2019-how-to-undo-almost-anything-with-git
For future reference, for those git situations we need some help to undo some mistakes.