git reset [file]
: Unstage a file that was added to the staging area.
git reset index.html
git reset --hard
: Discard all changes in the working directory since the last commit.
git reset --hard
git revert [commit]
: Revert a specific commit.
git revert a1b2c3d4
git stash
: Save your current changes and clean the working directory.
git stash
git stash pop
: Reapply the stashed changes.
git stash pop
git rebase [branch]
: Reapply commits on top of another base tip.
git checkout feature-branch
git rebase main
git cherry-pick [commit]
: Apply the changes introduced by a specific commit.
git cherry-pick a1b2c3d4
git tag [tag-name]
: Create a new tag.
git tag v1.0.0
git push [remote] [tag-name]
: Push a tag to a remote repository.
git push origin v1.0.0
git tag -d [tag-name]
: Delete a local tag.
git tag -d v1.0.0
git push --delete [remote] [tag-name]
: Delete a remote tag.
git push origin --delete v1.0.0