Changes lost in merge

Asked

Viewed 52 times

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?

  • Boy, business is bad: I don’t remember. With the hot head I closed the console.

  • takes a git log and takes a look at the sequence of commits, unlikely to have lost everything

  • 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 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?

  • Edit your question by updating the output of git log --all. Delete sensitive information (email, commit texts, etc), but leave branch names. At least commit 92039fc49952592... and the data you lost has to be visible.

  • @Giusti, ready to go

  • Okay, I think we can fix it. Just to confirm, the changes you want to keep are the ones that are in stash?

  • 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 spinning git merge refs/stash (in the copy). If all goes well, do it for real in the original repository.

  • I’m started now with Git, so I don’t have as much experience. I rode git merge refs/stash, but I did get Please commit your changes or stash them before you merge.. I decided not to give commit, and make a git checkout <hash do último commit> and the files came back. I did it right?

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.