eg. When you merged some commits but some day you want rollback to a specified commit but stay some usefull commits.
// Clone repository
git clone https://xxx/xxx/xxx.git
// Check all exist remote branches
git branch -r
// Checkout and push a branch for reset
git checkout origin/branch-for-reset
-b branch-for-reset
git push origin -u branch-for-reset
// Take a look at log
git log
// Reset to the specified commit
git reset --hard commit_id
// Push origin, --force
is important
git push origin branch-for-reset
:branch-for-reset
--force
// Recover commits which you do not want to delete, here you will resolve conflicts if exist
git cherry-pick commit - 1
git cherry-pick commit - 2
// Push origin
git push origin branch-for-reset
:branch-for-reset