# This will destroy any local modifications.
# Don't do it if you have uncommitted work you want to keep.
git reset --hard 0d1d7fc32
# Alternatively, if there's work to keep:
git stash
git reset --hard 0d1d7fc32
git stash pop
CONFLICT (rename/rename): Rename "will-be-renamed.txt"->"new-name-1.txt" in branch "HEAD" rename "will-be-renamed.txt"->"new-name-2.txt" in "branch2"
Automatic merge failed; fix conflicts and then commit the result.
If you want to keep one file, say new-name-2.txt:
git add new-name-2.txt
git rm new-name-1.txt will-be-renamed.txt
git commit
git merge -s ours branch1
The Ours strategy operates on multiple N number of branches. The output merge result is always that of the current branch HEAD. The "ours" term implies the preference effectively ignoring all changes from all other branches. It is intended to be used to combine history of similar feature branches.
You can actually do an empty rebase with:
git rebase --interactive HEAD
Now, just paste in additional hashes that you want to pick:
pick 1efd396b * Fixed a bug in frob function
pick f01934db * Awesome feature added
pick 6fd109c1 * Refactored the widgets layer
squash 3900fd77 * Refactored the widgets layer s'more
To produce the pick lists for this method, use git log --oneline --reverse from..to, then trim the output needed and prepend the rebase commands to each line: pick, squash