CentOS7 센토스가 머임
git 일반

git 원격 저장소 생성
git init --bare /home/git_reposigory/myproject.git

git 로컬 저장소 생성
git init

원격저장소 등록
git remote add origin ssh://[email protected]/home/git_reposigory/myproject.git

원격저장소 확인
git remote

git push origin master
git pull origin master

git-pull 후 삭제된 파일 복구 ==> pull 이전으로 되돌리자
git 로그 확인
git reflog or git log -git or git log --pretty=online --all --graph
커밋 시점으로 되돌리기
git reset --hard [commit_id]

실수로 파일을 삭제했을 때 복구
확인
git ls-files -d
복구
git checkout [file_name]
삭제된 파일 모두 되살리기
git ls-files -d | xargs git checkout --

[git] 삭제된 파일 복구하는 방법 (velog.io)

 

 

첨부파일
Comments
비밀글