Initially I have master and develop branch at the same state, but I accidently make some commits directly to the master.
Now I'm going to sync the master's commit to develop, but our practices is branch out feature from develop and make changes to the feature and then PR to the develop.
So I branched out a feature branch sync_up_develop_with_master and planned to cherry-pick the master's commit into this feature branch.
But I read some articles which says merge is preferable over cherry-pick (due to SHA1 identifier).
or should I just reset the commit in master since it's just minor changes.
Can anyone suggest me the correct approach on my case? Thanks.

In your situation: from branch
develop, you can runand
developwill be updated.--autostashwill handle thegit stash / git stash poparound your merge operation to port your uncommitted changes--ff-onlymakes sure thatgit mergewill perform only fast-forward actions. That way you are 100% certain that this command will not accidentally create an unwanted merge commit.