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.

  • What does it mean when it says a git step is “1 ahead”
  • How to do a “git checkout -b <branchname>” from a remote tag
  • Edit all conflicting files in a git merge/rebase (special character safe)
  • What exactly does the ReCommit feature in TortoiseGit do?
  • Best practice for managing project variants in Git?
  • Pull, rebase, push, in one command (or just a few)
  • 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


  • What is the old command of git clone -c in git version 1.7.1
  • Gitlab Pull a branch to the local machine
  • How to tell git that my local directory is a specific directory in the remote tree
  • how to checkout latest commit of a specific remote in bash script
  • Pull Request Metrics in Stash
  • Only build feature/* branches
  • 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.