Revert an uncommitted file in Git

I’m a relatively recent convert from Subversion to Git, so getting to know the git equivalent of an svn command is challenging.

Reverting a file in git actually uses the checkout command.

For example, if you want to revert your uncommitted changes for a file named package/File.java, then you would use the following command:

git checkout package/File.java
Advertisements

One Comment

  1. Almost all of what you articulate happens to be supprisingly appropriate and it makes me ponder why I hadn’t looked at this in this light previously. This piece really did turn the light on for me personally as far as this specific subject goes. Nevertheless there is actually 1 position I am not too comfortable with so while I attempt to reconcile that with the actual core idea of your point, permit me observe what all the rest of the readers have to say.Nicely done.

    Reply

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