February 8, 2013 0

git revert only one file that has not been committed

By in GIT

You have made changes to a file that you realize was wrong (eg. overrige a file’s content) and you want to revert it to the latest comitted version:

git checkout <filename>

If you have a branch with the same name you need to do:

git checkout — <filename>

source: http://norbauer.com/notebooks/code/notes/git-revert-reset-a-single-file

Tags: , , ,


Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/mgis.dk/about/wp-includes/class-wp-comment-query.php on line 399

Leave a Reply