1
1
111ilya1112019-06-25 19:34:50
git
111ilya111, 2019-06-25 19:34:50

How to cancel the first revert?

help me
made the first commit decided to revert it and did git revert HEAD.
and everything was deleted, how to cancel the revert and return the original state?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2019-06-25
@111ilya111

Use git reflog to restore the state.

T
tsarevfs, 2019-06-25
@tsarevfs

revert, unlike reset, does not remove a commit, but adds a new commit that cancels the specified one.
https://githowto.com/en/undoing_committed_changes
So you have 2 options:
Undo the reverting commit with revert
Remove the last commit with reset
evtuhovich.ru/blog/2009/04/03/git-reset

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question