To rollback to a previous migration in Laravel you can make use of the "migrate:rollback" command. This is very handy but sometimes you might need to migrate several steps back and although this is not common, there will be times that you need this.
php artisan migrate:rollback
You may roll back a limited number of migrations by providing the step option to the rollback command.
In order to rollback to several steps back, you can make use the "--steps" command and it looks like below. In this case it will go back 3 steps instead of the normal 1 step back.
php artisan migrate:rollback --step=3
Now when you run "migrate" command, your migration will be the one 3 versions ago. If you want to rollback and re-migrate then you can make use of the "migrate:rollback" command.
You may roll back & re-migrate a limited number of migrations by providing the step option to the refresh command
php artisan migrate:rollback --step=5
Leave a reply