(I am very new to this so please excuse incorrect language or any obvious mistakes I make)
Everyone at my job writes code under the same repository, but each on their own individual branches. Specifically, we write to a .ipynb file that I will call “File”. There is one master branch called “MAIN” where my boss compiles all of the generalizable portions of our individual work in a single place and includes proper documentation so we can share code with each other. This means that each individual branch and the MAIN branch have a file called File.ipynb. We only push to our own branch (never to MAIN) and pull from MAIN.
Last week, I was attempting to pull code from the MAIN branch into my branch. Something went wrong and it somehow only accepted the changes from MAIN, meaning it got rid of all my changes. This also means the local file was overwritten with only the pulled changes from MAIN, excluding my own work. Since we obviously use git, I did not think it would be a problem that I could go to my last commit and pull those changes back in. However, they somehow disappeared. I am new to VSCode so it may be that I was pushing thing improperly, but it says my last commit was several months ago which cannot be true.
I am wondering if there is any way to restore my code, possibly my accessing the previous version of the local file or manipulating git.
Please respond with any additional questions if you need clarification and thank you in advance!
I attempted to pull changes from one branch into another and instead lost everything in my original branch, as well as previous commits and the local file.
User9 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.