Git & Rails — I messed up, can i revert to last commit (delete model/controller/migrations/code)

This is my first time using any sort of version control (git) and excited to get a chance to see how well this works… I’m a bit confused on what all it can though.

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.

  • Git: Squashing consecutive commits that are not the most recent commits, and do not start at the root
  • Is it dangerous to include your googlecode password in .git/config?
  • How do I pass a range of commits to git log?
  • Complex Build/Project Management
  • How can I push to a git bundle
  • Git: keeping a project synced via mail
  • 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

    thanks

  • Git merge strategy for maven project hotfix releases with multiple branches
  • Why doesn't git format-patch work for stashes?
  • Git repository working with SSH
  • How do I move a commit between branches in Git?
  • git stash reporting: '' is not a stash reference
  • setgid bit not preserved by git on new directory in `.git` folder?
  • 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
    
    Git Baby is a git and github fan, let's start git clone.