Is there a way to "remerge" from master at a certain commit, as if I had never tried to git merge master
since that point in time?
Edit: I resolved my issue. Turns out I'm just new to git and was confused about basics of merging and conflicts. I'm rewriting this question now so that it makes sense to seasoned git users, but I'm going to keep some elements of my confusion / misguided thoughts, so that newbies having the same problem searching the same things, end up here.
tl;dr
- I panicked, backed up files, created a new branch, restored my files, and now I have diffs I don't recognize.
ntl;r
- I was working off a local branch over several days.
- A lot of people work on this repository. To keep in sync, I periodically
git merge master
ed. - Something went really wrong, and panicking, I
cp -R
ed to back up my source. - I disowned that branch and created a new one from master.
- I
cp -R
ed my backup back, intentionally overwriting the copy of the latest master. - I did a
git diff
, only to see hundreds of diffs I didn't recognize.
Analysis
I realize my mistake. Just copying / clobbering files means: no git history. That is, all my individual incremental commits as well as merges of others' commits from master, got "flattened" into a meta-data-less, dumb copy of text files. Once "restoring" my backup, it looks to git like I just made one giant change, with no trail of what's what. And because at the time I made my backup, I hadn't fully git merge master
ed, i.e. there were commits on the latest master I had never seen, I essentially reverted these from the latest master by clobbering with an old backup. Again: with no trail.
Proposed Solution
As a newbie, the solution to this, I thought, might be to: retrigger a git merge master
from a point in time (a commit) that I know I did already merge, thereby generating conflicts. Then, I thought I could simply Accept Theirs on all conflicts, since for any file or code I didn't touch, a conflict can only mean an accidental reversion due to my outdated backup: I can blindly Accept Theirs.
This is why I asked for a way to retrigger a merge (and in the original question, blindly accept all theirs, but I see the mistake in that part).