I have been switching between branches in a project and each of them have different migrations... This is the scenario:
$ rake db:migrate:status
<
If the migration files are truly missing (e.g. ran migration, forgot to roll back migration, then deleted migration file before commit), I was able to reproduce the missing migration as follows:
git log; git checkout xxxxxx; cp schema.rb ~/schema_old.rb, git checkout master).diff schema.rb ~/schema_old.rb > migration_file.rb; vi migration_file.rb) rake db:migrate:status; rake db:rollback; rake db:migrate:status;)