Skip to content

Instantly share code, notes, and snippets.

@allysonsouza
Last active October 25, 2022 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allysonsouza/caafdc0856bb4682978dbdf0603b4d71 to your computer and use it in GitHub Desktop.
Save allysonsouza/caafdc0856bb4682978dbdf0603b4d71 to your computer and use it in GitHub Desktop.
[Git Commands] Git commands #Git #snippets

Git Commands

Init repository

git init

Discard unstaged changes

git restore .

git restore path/to/file/to/revert

List commits

git log

Use ↑↓ to navigate, and q to exit.

Checkout

Checkout a specific commit

git checkout <commit-code>

Return to latest commit

git checkout -

Checkout creating a new branch

git checkout -b <branch-name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment