
Merging into a long-dormant branch has it's dangers. First off, to get back your changes, you want to roll back to where you were before you merged. If there's just one commit that's been made, you can: git reset --hard HEAD^ That will set the current HEAD to the previous commit, reset the index (where any files staged for commit (i.e. 'git add'ed) live), and rewrite the contents of your working directory to their state as of HEAD - 1. Note that this will nuke any uncommitted changes you have. (Discussion at https://git-scm.com/docs/git-reset) You can see what's changed since you branched, you can start with (in your branch): git log dev... which will give you the log since you branched. For details, you can do git diff <commit> where <commit> is the hash of the first commit in that branch. That will show you all the changed you've made since the first commit in your branch. If you want to go even further back, you need to find its parent. git cat-file -p <commit> will tell you that, then git diff <parent>. You can also do git diff dev to show you what's different between your current HEAD and the head of dev. You can do git merge --no-commit dev if you want to inspect the results yourself before committing. I'm a little worried that you said your changes were clobbered by the merge. Wasn't there a CONFLICT if both sides had changes? Of course, resolving large CONFLICTs can be a pain in the butt. It's good practice to keep your branch up-to-date with the main branch for just these reasons. Hope this helps. Feel free to poke me for more help. On Tue, Mar 8, 2016 at 9:50 AM, Syd Bauman <syd@paramedic.wwp.neu.edu> wrote:
So it has been a long time since I worked on my dating attribute semantics branch (sydb-datAttSem). I figured it would make sense to merge in whatever was being done on dev to make sure it was not incompatible in some way. So I made sure I was on the sydb-datAttSem branch, and issued `git merge dev`.
I'm guessing that was not a clever thing to do. First, git required me to fix conflicts in 3 files I have not touched since before we moved to git. Second, it wiped out my changes to ND, the chapter I had been working on! Now, of course, my work isn't gone -- I have other copies and even if I didn't, git is a version control system, my previous work is in there somewhere.
But what should I have done, if anything, instead? And how do I ask the question "hey, it's been a long time since I worked in this branch, what had I changed herein?" -- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
PLEASE NOTE: postings to this list are publicly archived