github - git pull Deleted My Files with Remote -
we 2 people working on same project. friend told me has done part , pushed github. part has finished today wanted push too.
to accomplish, wanted pull first, merge files locally , push again.
while trying update local repo commit, used git pull
, resulted work gone, , instead of files, files appeared.
i want recover files , correctly update repo files.
it mentioning process: got local branch named "entrance" first, switched master, git merge entrance
files being merged, showed on screen thought merge done. @ last, used git pull
.
if meet case, steps below:
at first, make sure commit code before pulling friend's code.
show
reflog
check history command:git reflog
output should be:
$ git reflog 90abbe3 head@{0}: pull origin master: fast-forward 3ab3527 head@{1}: commit: q defer 962e856 head@{2}: commit: getall terms tax 2d7f20d head@{3}: commit: bug list create
reset previous commit command:
git reset --hard head@{1}
investigating reason why code gone using commands
git diff
,git branch
..finally, find issue , merge source agian
git merge
orgit pull
Comments
Post a Comment