0

After a while using github ...I've deleted few files in local repository(accident) and without realizing it added newfiles in local repo.

Now I want the deleted files from remote and at the same time retain the local files. What should be the process?

WhyJava
  • 110
  • 3
  • 10
  • Possible duplicate of [Git - deleted some files locally, how do I get them from a remote repository](https://stackoverflow.com/questions/4235431/git-deleted-some-files-locally-how-do-i-get-them-from-a-remote-repository) – Madhu Bhat Jul 06 '19 at 16:26

1 Answers1

0

In case your changes are too extreme shifting to the previous commit might be not helpful at all.

I will suggest make another branch and commit your work in that branch and later pull the master code for adding the previous files you lost.

git checkout -b new_branch_name
git add .
git commit -m "some_message"
git push origin new_branch_name
git pull origin master