In a topic branch I wrongly duplicated a model and a migration (previously created in the master branch) with:
rails generate model User name:string email:string
bundle exec rake db:migrate
The duplicate model was created but the migration failed because the database already had a users
table. Following instructions in how to discard git local branch changes?, I tried to discard all uncommitted changes with git reset --hard
, but git status
still shows presence of untracked files:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
app/models/user.rb
db/migrate/
test/fixtures/users.yml
test/models/user_test.rb
# nothing added to commit but untracked files present (use "git add" to track)
Why did git reset --hard
preserve these files? What can I do to safely remove this files in order to completely reset the topic branch to the last commit? Would rails destroy model User
suit me?