SVN revert equal in Git

Using git, coming from SVN and want to revert changes on a file? In SVN it used to be:

svn revert filename

Well revert in git isn’t what you want to do in this case. Due to it’s local repository you have to think a bit different here. When checking out you get the latest committed version from your local repository, so what you actually have to do is the following:

git checkout filename

Now you have the equivalent to the gold old revert.

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

%d bloggers like this: