How to use 'git undo' which can be easily undone when you make a mistake in Git operation

Arxanas, an engineer who works on Twitter, has developed and released a command 'git undo ' that allows you to redo most operations in 'Git ', which is often used as a version control system for programming.

git undo: We can do better

Git is designed so that data is not easily lost due to various accidental mistakes of the user, but it is different depending on each situation to return to the original state even if you actually make an operation mistake. There are many cases where you have to use the command of 'Beginners make more mistakes and make it complicated and strange'.

To solve this situation, arxanas developed 'git undo'. As the name implies, git undo is a command that allows you to redo an operation that you made a mistake. There are several demo movies available, for example, how to fix a commit that was mistakenly replaced with '--amend' is as follows.

The correct commit 'foo' has been replaced with the incorrect commit 'foo bad'.

When you start git undo, 'What kind of operation do you intend to restore?' Is displayed, so if there is no problem, enter 'y'. This settles one case.

There is also a demo movie on how to fix conflicts if you make a mistake when merging.

The git undo function is created using Git's reference-transaction hook. The code is published on GitHub, and the installation method can also be confirmed on GitHub.

in Software, Posted by log1d_ts