我已经对作为一组文件的一部分提交了几次的文件进行了一些更改,但现在想要将其上的更改重置/还原到以前的版本.
我已经做了git log一个git diff找到我需要的修订版,但是根本不知道如何将文件恢复到以前的状态.
我的应用程序在生产中运行良好,但是当我转移到生产并运行“heroku run rake db:migrate”时,出现以下错误:
PG::UndefinedTable: ERROR: table "applications" does not exist
Migrating to DropApplications (20160509013805)
(0.8ms) BEGIN
== 20160509013805 DropApplications: migrating =================================
-- drop_table(:applications)
(1.1ms) DROP TABLE "applications"
(0.5ms) ROLLBACK
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: table "applications" does not exist
: DROP TABLE "applications"
Run Code Online (Sandbox Code Playgroud)
但是,我的数据库中有一个“应用程序”表。这次下降可能与我前几天下降然后重新制作应用程序脚手架有关。我该如何解决?
create_table "applications", force: :cascade do |t|
t.string "name"
t.string "gender"
t.date "date_of_birth"
t.string "gpa"
t.text "essay"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end …Run Code Online (Sandbox Code Playgroud)