-1

Need your help please I've tried to run my first commit and all the files in the folder have disappeared.

Is there any way to restore them?

Searched for the files from home dir and they are not on my Mac, no backup, tried to restore with pycharm from local history - files were restored but they are blank.

Those are the commands I used:

git add .
git commit -m "first commit"
git push -uf origin master
git push -uf origin driver_account_be_automation
git reset --hard HEAD~1
git push -uf origin driver_account_be_automation
git reset --hard HEAD
git reset --hard 
git reset --hard 2dfe5d6e6a47696c11d40a963b1b886071c18a9f
git add .
git commit -m "first commit"
git push -uf origin driver_account_be_automation
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

2 Answers2

1

Your initial commit is still in the reflog.

Run git reflog to spot its sha, then git reset --hard <sha> to return to its state.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
0

Use git log -n <NUMBER> - to find your commit. Then you may use the new branch and cherry-pick your commit with its UID to that new branch. And then commit, push and merge.

LevAri
  • 11
  • 2