Git & Rails — I messed up, can i revert to last commit (delete model/controller/migrations/code)
I have a master branch were I keep all my tested, everything works commits….and I’m currently on the development branch where I’m adding some new features.
I added a model/controller and migrated the database and created some routes.
I didnt commit any of these changes since I f*cked up in a major way somewhere in the process.
How can I revert back to the last state of the development branch…pre-generation of model/controller/migrations…where everything worked.
is there one command that will change the database as well as everything else..
I’m using rails 3 and sqlite, if that helps
One Solution collect form web for “Git & Rails — I messed up, can i revert to last commit (delete model/controller/migrations/code)”
Revert to the latest HEAD with:
git reset --hard HEAD