Can't undo discard with ruby-on-rails


#1

I’m working with Atom and Git in a Ruby on Rails project. Unfortunately today I discarded unstaged changes on my development.sqlite3 database. I tried to recover via “Undo Discard” but was not successful. A merge conflict appears and the Atom console says:

GitError: git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false merge-file -p db/development.sqlite3 /private/var/folders/4r/4dj62r992jd05pwt8y9h29jw0000gn/T/github-discard-history-118028-13442-17wmext.0ll9ykfbt9/db/development.sqlite3-after-discard /private/var/folders/4r/4dj62r992jd05pwt8y9h29jw0000gn/T/github-discard-history-118028-13442-17wmext.0ll9ykfbt9/db/development.sqlite3-before-discard -L current -L after discard -L before discard in /Users/xxx exited with code 255 stdout: stderr: error: Cannot merge binary files: db/development.sqlite3

at new GitError (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:104:24)
at /Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:362:33
at Generator.next ()
at step (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:92:197)
at /Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:92:367
(anonymous) @ :104770 step @ :104089 (anonymous) @ :104089

Is there any possibility to rescue my last state? I know that rails db and merging conflicts are a special thing but I hope to get rid of it. I don’t want to loose hours of work.

Thanks.


#2

I am not a pro git user, but that sounds fairly final. The unstaged changes were in a file that git can’t actually see inside, so it can’t do its normal trick of tracking lines that have changed.