0

I have a branch in a Git and in that branch I have made my local changes.

But to push to master I have created a new branch all the files in my previous branch which is in my local got deleted.

Is there a way to recover those?

Have spend lot of time installing recovery softwares and going through all the posts but don't find anything useful. So thought to ask the community for help.It will be very helpful to get some suggestions.

Thanks in advance

Linu
  • 589
  • 1
  • 10
  • 23

1 Answers1

0

in that branch I have made my local changes

And did you commit those changes? If so, no problem; Git has them. That is what Git is for! They are part of the branch you were on, before you made this new branch. So, to see them again, you can check out that branch again, or you can merge that branch into this one, or you can even check out the files by name into the current branch.

But if you somehow checked out a branch without committing the local changes in the old branch, then there is nothing you can do; Git is not responsible for anything but commits.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Unfortunately it happened before committing to Buy.Is there any solution to retrieve it? – Linu Nov 09 '20 at 21:52
  • Probably not. Committing is like saving. If you don't commit, you are saying it's okay to lose all your work. – matt Nov 09 '20 at 22:29