ugit

Undo git commands and recover from mistakes easily

brewmacoslinux
Try with needOr install directly
Source

About

Undo git commands. Your damage control git buddy

Commands

ugit

Examples

Show available undo actions for recent git commands$ ugit log
Undo the last git command that caused issues$ ugit undo
Undo a specific git command by number from the log$ ugit undo 2