$ git branch | grep " pattern " | xargs git branch -D
$ git rm --cached mylogfile.log
$ For a directory:
$ git rm --cached -r mydirectory
$ git rev-list --no-merges --count HEAD ^develop
Cherry-pick range of comits step by step stackoverflow:
$ git rev-list --reverse --topo-order B^..D | while read rev
do
git cherry-pick $rev || break
done