-1

I do by error pull of a project on Github in local project so all project in local are deleted and replace by the github project.

note: the project on Github is Flutter project and the local project is Laravel one.

How can I find my Laravel project?

this some code maybe help to resolve this issue

$ git status .
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
    test.sh
nothing added to commit but untracked files present (use "git add" to track)
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
user41vall
  • 11
  • 1
  • 3
  • 2
    Pull doesn’t delete anything (that you can’t get back at least). May you give us more context? – evolutionxbox Jun 07 '20 at 00:11
  • `git pull` does the equivalent of running `fetch`, then `merge`. All your commits are still there (your most recent state most likely in `HEAD^`). If you do not have local changes, a hard reset will do. If you have local changes, stash before you reset. – knittl Jun 07 '20 at 06:30

1 Answers1

1

This worked for me.

First you have to find out the commit-hash that was before the git pull. (very easy with git log)

Then you can set back your local repo to the state from the previous commit. As example (the commit-hash must be adjusted with yours)

git reset --hard abc1234a

You can also look with git reflog and reset your local repository back with git reset --hard HEAD@{1}

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34