Skip to content

Instantly share code, notes, and snippets.

@noghte
Last active March 20, 2019 06:41
Show Gist options
  • Save noghte/83a941f6046f7f5cd3cfbbc283412e07 to your computer and use it in GitHub Desktop.
Save noghte/83a941f6046f7f5cd3cfbbc283412e07 to your computer and use it in GitHub Desktop.
github

Branch

  • Create a branch: git checkout -b branch_name
  • Push a branch to remote: git push -u origin branch_name
  • Pull a branch from remote: git checkout --track origin/branch_name

Undo

  • Revert some files to their previous version:
    git checkout commit-hashcode~1 -- file1 file2 file3
  • Revert some files to a specific commit:
    git checkout commit-hashcode file1 file2 file3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment