checkout -i , , . git revert , , .
foo A:
:
git co -b halfFoo foo~
git checkout -i foo
git commit
:
\
\-halfFoo
, foo , halfFoo, git revert:
git co -b otherHalfFooWithHistory foo
git revert halfFoo
---A---foo
\ \-otherHalfFooWithHistory
\-halfFoo
Which is conceptually what you want for otherHalfFoo, but has a story in which all foo exists, and then some of them were deleted. You can optionally clean it with merge --squash:
git co -b otherHalfFoo foo~
git merge
git branch -D otherHalfFooWithHistory
|\
| \-halfFoo
\
\-otherHalfFoo
source
share