3 ms·
git is already an undo mechanism itself. Commits are immutable. `git reflog` provides an undo log for pretty much every operation on the repository. `git push`
by seba_dos1 4y ago
git is already an undo mechanism itself. Commits are immutable. `git reflog` provides an undo log for pretty much every operation on the repository. `git push` shows the previous state of the branch which you can use to easily undo what you just did on the remote.
The only part that isn't easily undo-able is the index and working dir, but that's kinda the point of having an index in the first place. If you overwrite or delete a file without staging it in git, or unstage and then change it, git isn't going to magically restore it with an undo command. And that's fine.