You have to give format:%H
to git log
and use a loop:
for sha in `git log --pretty=format:%H --author=Mohsen --since=4.days`; do
git revert --no-edit $sha
done
This will create one commit per revert. Suppress the --no-edit
option to modify interactively the commit message on each revert.
Or, if you want to make one big revert commit:
for sha in `git log --pretty=format:%H`; do sharange="$sharange $sha"; done
git revert $sharange --no-commit
git commit -m "reverted commits $sharange"