R
R
Roman Chugunov2017-08-27 21:59:35
git
Roman Chugunov, 2017-08-27 21:59:35

How to undo git reset --hard ???

Hello! Urgently need help.
It was necessary to remove the commit, but leave the directory and files intact. Made according to this article https://githowto.com/ru/removing_commits_from_a_branch
As a result, I lost all the files, the whole project...
How to return the commit and files?
Help, and then re-write it all PPC. This file is not in the repository.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Chugunov, 2017-08-27
@Chalovik

It seems that I found a solution, the git reset --hard [email protected]{1} command helped

I
invzbl3, 2019-07-02
@invzbl3

Yes, git reset --hard [email protected]{1} will roll back the last action. If you want to commits, you can also use:
git reset --hard HEAD~1
If it's about time, then you can:
git reset --hard [email protected]{"10 minutes ago"}
or
git reset --hard [email protected]{14 :thirty}

A
Alexey Shumkin, 2017-08-28
@ashumkin

git reflog Inside
Git: Maintaining and restoring data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question