rails undo db migrate code example
Example 1: rails revert migration
rake db:rollback
Example 2: rails db:rollback
rake db:rollback VERSION=n
# n = the version you want to rollback to
rake db:rollback
rake db:rollback VERSION=n
# n = the version you want to rollback to