Git – Revert Changes

Sometimes we may want to revert the changes in the working tree. Let’s delete some files in the Rails project.

1. Delete the app/controllers folder

  • rm -r ./app/controllers

 

2. Let’s check what i have just done by git status

 

3. Revert the changes

  • git checkout -f

 

4. Check the working tree again by git status

 

Done =)

Reference: Ruby on Rails Tutorial – 1.3 Version control with Git

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s