Create .sh file and copy the below script and run.
Note that the commitcode.txt should be the path to a text file containing hash code of commits (first 7 code), the commit code should be one below the other.
git fetch –all
for commitcodes in $commits
git cherry-pick $commitcodes