- Check for SSH keys. Have an existing key pair? You can skip to Step 4.
First, we need to check for existing ssh keys on your computer:
$ cd ~/.ssh
If it says “No such file or directory“ skip to step 3. Otherwise continue to step 2.
- Backup and remove existing SSH keys.
Since there is already an SSH directory you’ll want to back the old one up and remove it:
$ ls
$ mkdir key_backup
$ cp id_rsa* key_backup
$ rm id_rsa*
- Generate a new SSH key.
To generate a new SSH key, enter the code below. We want the default
settings so when asked to enter a file in which to save the key, just
press enter.
$ ssh-keygen -t rsa -C "your_email@youremail.com"
- Test everything out.
To make sure everything is working you’ll now SSH to GitHub. Don’t change the “git@github.com” part. That’s supposed to be there.
$ ssh -T git@github.com
- Reverting changes:
- Reverting unstaged changes we just mad
$ git checkout -- fileName.txt
- Reverting Changes of entire working dir $ git checkout -- .
OR $ git checkout HEAD
- Reverting staged changes( git add. ) git reset fileName.txt
git checkout fileName..txt // And then checking it out,leaving other untouched
OR
To revert all changes: git reset --hard HEAD
- Reverting changes in nascent directory where there is No HEAD git rm --cached fileName.txt
Reference:
http://help.github.com/git-cheat-sheets/
Reverting Changes: http://www.szakmeister.net/blog/2011/oct/12/reverting-changes-git/
No comments:
Post a Comment