Using git, how do you reset the working tree (local file system state) to the state of the index (“staged” files)?

I tend to use git checkout . which discards all changes from the working directory down. This makes a difference if you’re not at the root of the repository.

This command doesn’t remove newly created files which is usually a good thing. If you need to do this then you can use git clean as well.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)