github - Git - Recovering a commit after checking out of branch -
i started working git , terrified might have lost whole day hard of work. take , tell me if there way recover commit?
i working on branch. did added files, commmited , performed push branch (i confused branch names...) . did checkout master because wanted merge everything. that's think screwed up. there way recover files commit? thanks
yuri:python yurir.tonin$ git checkout -b branch1_2files m .ds_store switched new branch 'branch1_2files' yuri:python yurir.tonin$ git status on branch branch1_2files changes not staged commit: (use "git add <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) modified: .ds_store modified: gui/dicomroi_more_files.py modified: gui/dicomroi_single_file.py no changes added commit (use "git add" and/or "git commit -a") yuri:python yurir.tonin$ git add . yuri:python yurir.tonin$ git commit -m "edited file dicomroi_more_files.py receive , analyze data multiple aquisitons, is, multiple folders containing dicom images obtained @ different flip angles)" [branch1_2files 666a146] edited file dicomroi_more_files.py receive , analyze data multiple aquisitons, is, multiple folders containing dicom images obtained @ different flip angles) 3 files changed, 140 insertions(+), 53 deletions(-) yuri:python yurir.tonin$ git push origin gui_branch counting objects: 5, done. delta compression using 4 threads. compressing objects: 100% (5/5), done. writing objects: 100% (5/5), 1.10 kib | 1.10 mib/s, done. total 5 (delta 1), reused 0 (delta 0) remote: resolving deltas: 100% (1/1), completed 1 local object. https://github.com/yurirt94/tcc.git * [new branch] gui_branch -> gui_branch yuri:python yurir.tonin$ git checkout master switched branch 'master' branch up-to-date 'origin/master'. yuri:python yurir.tonin$ git merge gui_branch warning: cannot merge binary files: .ds_store (head vs. gui_branch) auto-merging gui_old/dicomroi_v3.py auto-merging .ds_store conflict (add/add): merge conflict in .ds_store automatic merge failed; fix conflicts , commit result. yuri:python yurir.tonin$ git status on branch master branch up-to-date 'origin/master'.
commit still in local branch1_2files branch.
just abort merge , go branch
git merge --abort git checkout branch1_2files now should fix wrong push , merge again
Comments
Post a Comment