I used git a month ago for contributing in a project. There I made a branch of my name and added files in the same branch. After that I uninstalled git. Now again I installed git and made a new branch with the same name. But this branch is not showing commits I made earlier. My question is how do I recover my old branch on whom I was working. Please help and I will be very thankful.
CodePudding user response:
If before you deleted git you were checked out to that branch then, if you still have the folder you may see the files there. If this is not the case then unless you pushed the changes to a remote repository like on GitHub then I don't think there's a way to retrieve them.
CodePudding user response:
You gave very few details about your problem.
I think you're talking about a project in an online repository.
If you pushed your commits, then it should be all in the online repo, so with a git clone https://....
you download all the packets and with something like git log --all
you can see all the commits/branches.
If you haven't pushed the changes, but the file you changed is still in your local repository (with its .git
folder), the branch must be present here.
You must provide more details if it's not what you asked!