CheatSnip

Related

Check Repository Status

git

Display the current state of your working directory and staging area, showing which files are modified, staged, or untracked

Show Changes

git

Show changes between commits

Commit Changes

git

Create a commit to permanently record staged changes in the repository history with a descriptive message

git/reset

Reset Changes

Reset current HEAD to the specified state

git
reset
changes

Command

git reset

Explanation

git reset is used to reset the current HEAD to the specified state. It resets the current HEAD to the specified state.

Examples

Undo last commit, keep changes

git reset HEAD~1

Undo last commit and discard changes

git reset --hard HEAD~1

Unstage file

git reset file.txt

More

Stash Changes

git

Temporarily save your uncommitted changes without committing them, allowing you to work on something else and restore them later

Apply Stash

git

Reapply previously stashed changes without removing them from the stash list

Pull from Remote

git

Download and integrate changes from a remote repository into your current local branch, combining fetch and merge in one command

CheatSnip

Lightning-fast access to essential developer commands and code snippets. Search, copy, and master your favorite tools with our comprehensive cheat sheets.

Poorna Prakash

Quick Links

Git CommandsDockerNPMKubernetesYour Favorites

Legal

Terms & ConditionsPrivacy PolicyCookie Preferences

Company

About UsContact

© 2025 CheatSnip. All rights reserved.

Made with ❤️ for developers