Git & Rails - I messed up if I can return to the last commit (delete model / controller / migration / code)

This is my first time using any kind of version control (git) and excited to be able to see how well this works ... I am a little confused about having everything that can, though.

I have a leading branch, I checked everything, everything works, commits .... and I'm currently developing where I add some new features.

I added a model / controller and migrated the database and created some routes.

I did not make any of these changes since I f * cked mainly in this process.

How can I return to the last state of the development branch ... preliminary generation of the model / controller / migration ... where it all worked.

there is one team that will change the database, as well as everything else.

I use rails 3 and sqlite if this helps

thank

+3
source share
1 answer

Go back to the last HEAD with:

git reset --hard HEAD
+7
source

Source: https://habr.com/ru/post/1781687/


All Articles