A
A
Alex Som2017-09-01 12:16:19
git
Alex Som, 2017-09-01 12:16:19

Initializing git. Get back deleted files?

I wrote a bunch of code with folders and files, then I decided to initialize the project using the git code built into visual studio and accidentally clicked "revert all changes" instead of commit and everything that was in the project disappeared. Tell me how to return all files before git initialization?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2017-09-01
@saboteur_kiev

Похоже никак. Только undelete/теневые папки, бэкапы

E
eRKa, 2017-09-01
@kttotto

If you canceled uncommitted changes, then nothing.
VS created a repository, it is empty, this is its first initial state, then changes were added there, then without committing the changes, these changes were canceled. Git only knows committed states, which is why it rolled back to the nearest one, an empty project.
But you can’t accidentally cancel the changes, you need to press the confirmation button.

A
Andrey Andreev, 2017-09-01
@b0nn1e

Look in the git reflog to see if there's anything left.

A
Alex Som, 2017-09-01
@commondore_web

Yes, I wanted to add some files to gitignore and I poked something in the wrong place, thanks, I restored almost everything using the HDD recovery utility, except for a couple of files, I will have to add them manually

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question