Skip to content

Instantly share code, notes, and snippets.

@techprasoon
Last active March 15, 2024 20:55
Helpful GIT Commands
# Undo all changes
# ----------------
git reset --hard origin/<branch_name/master>
git pull
# Overwrite Local Files
# ---------------------
git fetch --all
git reset --hard origin/<branch_name/master>
# OR
git reset --hard origin/<branch_name/master>
# Undo Specific files
# -------------------
git checkout -- <filename.txt>
# To get git commits in a certain time period
# -------------------------------------------
git log --pretty=format:"%ad - %an: %s" --after="2022-03-01" --until="2022-04-01"
# GIT remove saved username and password
# --------------------------------------
git config --system --unset credential.helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment