I created an experimental branch from master, and made four commits on the experimental branch. The master, in the mean time, still remains where it last was. Now, I want to merge my experimental branch in such a way that I will be able to easily undo this merge in future.
When I tried searching, the easiest way to undo a merge seems to me like git revert hash_of_merge_commit
.
However, this only works when I get a merge commit hash when merging my master with experimental branch. In this case, since master's HEAD has not progressed, when I try to merge, I just get four new commits added to master, and this would mean that to undo this merge, I would need to manually remember and revert each of these individual commits in future.
Any better way to do this?