Thursday, 8 January 2026

Git revert vs cherry pick

 I have a main branch and a development branch. I merged development into main, but later realized that the changes should not have gone into main. Even though several commits were added to main after the merge, the correct and safe way to roll back only the merged changes is to revert the merge commit, not reset the branch.

Using git revert -m 1 <merge_commit_hash> creates a new commit that undoes only the changes introduced by the merge while keeping all subsequent commits intact. This approach is safe for shared branches and preserves Git history.

git cherry-pick, on the other hand, is used to selectively copy specific commits from one branch to another. It is useful when only certain fixes or features are needed, but it should not be used for rolling back a merge. For rollback scenarios, git revert is the correct choice; for selectively applying commits, git cherry-pick is appropriate.

Wednesday, 7 January 2026

stream performance testing

 https://medium.com/javarevisited/high-performance-programming-with-java-streams-debeb374008f