The tutorial provides you with information you need to discard the unstaged changes in the working copy. Find several ways of discarding and get the codes.
While working with Git, it is sometimes necessary to get rid of local (untracked) files from your current Working Tree. Learn how to do it in this snippet.
Read this tutorial and know how you can solve your problem of reverting all local changes in Git managed project to previous state with most used commands.
Read this tutorial and solve the problem of stashing untracked files including ignored files in .gitignore. Find method presented by Git new versions.