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:

  1. at first, make sure commit code before pulling friend's code.

  2. 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 
  1. reset previous commit command: git reset --hard head@{1}

  2. investigating reason why code gone using commands git diff, git branch ..

  3. finally, find issue , merge source agian git merge or git pull


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -