rollback 1 migration ruby code example Example 1: rails revert migration rake db:rollback Example 2: rails redo last migration rake db:migrate:redo STEP=n