0
Guys, I merged wrong and all the new changes were lost. And the commit before the merge was two months ago. The sad question is: all the changes were permanently lost?
Log
commit d52ac4b.....3ccf2a (refs/stash)
Merge: 92039fc xxxxxx
Author: @iann00 <[email protected]>
Date: Tue Oct 1 09:51:45 2019 -0300
On development: Uncommitted changes before Checkout at 01/10/2019 09:51
commit 9233eb3e....6ccb614
Author: @iann00 <[email protected]>
Date: Tue Oct 1 09:51:45 2019 -0300
index on development: 92039fc Merge branch 'development'
commit 92039fc499525926cf306d08d039c7eaac91ff0a (HEAD -> development, origin/master, master, dev)
Merge: d99fc98 5265edf
Author: @iann00 <[email protected]>
Date: Tue Oct 1 08:20:56 2019 -0300
Merge branch 'development'
commit e06c03d3....0818f508 (market)
Author: @iann00 <[email protected]>
Date: Tue Oct 1 08:05:25 2019 -0300
v1.1.6
There’s usually no way you can merge a modified repository without doing a commit or stash. What exactly was the command you rotated to merge?
– giusti
Boy, business is bad: I don’t remember. With the hot head I closed the console.
– Ivan Silva
takes a git log and takes a look at the sequence of commits, unlikely to have lost everything
– Lucas Miranda
Spin
git log --all
to see the history of all branches. Maybe your modifications are in some. If you are on Linux, check the command history, probably on~/.bash_history
.– giusti
@Giusti and @Lucasmiranda, rodei
git log --all
as Giusti said and the previous commit of the nonsense I did is here!! How can I recover now?– Ivan Silva
Edit your question by updating the output of
git log --all
. Delete sensitive information (email, commit texts, etc), but leave branch names. At least commit92039fc49952592...
and the data you lost has to be visible.– giusti
@Giusti, ready to go
– Ivan Silva
Okay, I think we can fix it. Just to confirm, the changes you want to keep are the ones that are in stash?
– giusti
If that’s it, then I guess you just need to merge the
master
with that stash. But I’m not going to write an answer because I’m not very confident. I recommend making a full copy of this (local) repository before trying. Once done, simply try spinninggit merge refs/stash
(in the copy). If all goes well, do it for real in the original repository.– giusti
I’m started now with Git, so I don’t have as much experience. I rode
git merge refs/stash
, but I did getPlease commit your changes or stash them before you merge.
. I decided not to givecommit
, and make agit checkout <hash do último commit>
and the files came back. I did it right?– Ivan Silva