To ignore all “.swp” files add the following line to your “.git/info/exclude” file.
.gitignore
My .gitignore file.
Initializing a bare repo
Creating a remote branch
Branches
Playing with branches(create, switch, merge)
Adding a new remote repository
Undo(revert) committed changes
To revert the most recent commit
Lets say you changed some files in your working tree and you haven’t committed yet, but suddenly you decide that it was a big mistake and you want to go back to last committed state. You could undo uncommitted changes with the following command.