Category · 1 tool · 1 guide
Git and GitHub tools
Git is the version control system behind nearly every software project, and GitHub, GitLab and Bitbucket are built on top of it. Every developer uses a handful of commands daily: commit, pull, push, branch. The trouble starts with everything else: undoing a commit that was already pushed, moving work to another branch, cleaning up history before a review, or recovering something that seems lost.
Git's command line is powerful but inconsistent. The same word means different things in different commands, several commands overlap, and a few, such as reset --hard and push --force, can destroy work if used at the wrong moment. Searching the web gives answers that are outdated, written for a slightly different situation, or missing the warning that matters.
The tools here start from what you are trying to do, not from command names. They give you the exact commands for your branch and file names, explain what each one does, and clearly mark the ones that rewrite history or delete changes. They run in your browser and never touch your repository.
Tools in this category
Common tasks
- Undo the last commitGet the right command for whether the commit is local only or already pushed, and whether to keep the changes.
- Choose between restore, reset and revertUnderstand what each command changes and which one is safe on a shared branch.
- Review a change outside the repositoryPaste two versions of a file to compare them line by line when they are not in Git.
- Clean up a project READMEFormat the Markdown in your repository so it renders consistently on GitHub.
- Write a commit-friendly config changeNormalise YAML formatting before committing so the diff only shows the real change.
Key concepts
- Working tree, index and HEAD
- The working tree holds your files, the index (staging area) holds what the next commit will contain, and HEAD points at the current commit. Most undo commands differ only in which of these three they change.
- Rewriting history
- Commands like commit --amend, rebase and reset replace commits with new ones. That is fine for unpushed work but forces everyone who pulled the old commits to repair their branches.
- Reflog
- A local log of every position HEAD has pointed to. It is how you recover commits after a bad reset or rebase, and entries are kept for about 90 days by default.
- Merge vs rebase
- Merge joins two branches with a merge commit and keeps history as it happened. Rebase replays your commits on top of another branch for a linear history, creating new commit IDs.
- --force-with-lease
- A safer force push that refuses to overwrite the remote branch if someone else pushed since you last fetched. Plain --force overwrites silently.
Best practices
- Never rewrite history on shared branches like main; use git revert to undo published commits.
- Use git push --force-with-lease instead of --force when you must update a rebased branch.
- Commit small, focused changes with messages that explain why, not just what.
- Run git status and git diff --staged before committing to avoid including stray files.
- Before a risky operation, create a backup branch with git branch backup-name; it costs nothing.