<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reset(self, path, pretend=False):
 """ Rolls all of the currently applied migrations back. :param path: The path :type path: str :param pretend: Whether we execute the migrations as dry-run :type pretend: bool :rtype: count """

        self._notes = []

        migrations = sorted(self._repository.get_ran(), reverse=True)

        count = len(migrations)

        if count == 0:
            self._note("<info>Nothing to rollback.</info>")
        else:
            for migration in migrations:
                self._run_down(path, {"migration": migration}, pretend)

        return count