Stefan Baumgartner

Web ops, performance and front-end

Reverting a single file

05 January 2015 by @ddprrt | Posted in: Git

You can do the following to revert a single filename to its previous status.

If the file isn’t commited:

git checkout filename

If the file is already commited

filename is the path to your file, abcde is the hash of the commit you want to switch to.

git checkout abcde filename


git reset abcde filename

Comments? Shoot me a tweet!