Reputation: 943
So basically, here's what happened with me:
So my question is: Is there any way for me to recover the files? Note that my terminal session is still running and I will keep it running until I either get a solution to recover my changes or I find out that those changes are lost forever. HELP!!!!
Thanks,
-Vivek Kinra
Upvotes: 0
Views: 1744
Reputation: 606
I think your previous work in dev was mixed with your test work in testbanch.
I'm not sure how much test work you have done in testbranch. If you haven't done a lot of work, you could:
First pick the commit tag in testbranch through git log.
git checkout testbranch
git diff "tag" > /location/out/of/repo
Edit /location/out/of/repo, delete the work you have done for test.
git checkout dev
git apply /location/out/of/repo
Upvotes: 0
Reputation: 77007
Your changes are not lost.
The first time they were there on the new testbranch
after step 3, it was because the changes weren't committed to branch dev
.
Next, when you committed those to the testbranch
, the commit got associated with testbranch
, and thus won't be available on dev
branch before you explicitly tell git
to do so.
In this case, it seems to me that you are fine with all the code in testbranch
to be brought into dev
branch, so you can do a simple merge
.
git checkout dev
git merge testbranch
This will bring all your changes to dev
branch.
Upvotes: 2