문제

I have a problem with a git repository. I will describe what I did.

  • I have created a repository in side an existing folder with files using the command git init
  • I added a remote with git add origin git @ ...
  • Instead of commit I used the command git pull origin master what override my files, files with an empty repository

Is there any way to restore my files?

도움이 되었습니까?

해결책

a git pull is a fetch and a merge so is reversable for security checkout a new branch:

git checkout -b restore

then go back with

git reset --hard HEAD^
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top