Tutorials  /  Linux Basics

Clean Up Git History: Remove or Recover Commits Safely

Ccentron Redaktion · August 2025 ·6 min read ·Linux Basics, Tutorial

It’s not uncommon to accidentally commit unintended changes or confidential data to a Git repository—either local or remote. Fortunately, Git includes powerful tools for rewriting commit history. These allow you to clean up mistakes, remove sensitive content, and simplify your commit logs. This tutorial walks you through effective methods for removing Git commits from both local and shared repositories.

Quick Reference Guide

Below is a summary of commonly used commands:

Console
# Show compact commit history
$ git log --oneline

# Undo most recent commit (remove changes)
$ git reset --hard HEAD~1

# Delete a specific commit via interactive rebase
$ git rebase -i HEAD~N

# Retrieve removed commit via reflog
$ git reflog
$ git reset --hard HEAD@{n}

# Wipe a file or folder from all commit history
$ git filter-repo --path <path> --invert-paths
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Viewing Commit Logs in Git

You can review your commit history using Git in either a concise or detailed format. This helps in identifying and managing specific commits.

Command Syntax

Console
git log [OPTIONS]
  • git log: Lists all commits with hash, author, timestamp, and message.
  • --oneline: Displays each commit on a single line using hash and message.

Compact History View

Console
$ git log --oneline

Example Output:

Code
e2369629 removed requirement.txt file
2e39f29b Used Poetry for dependency management
2f7490ae modularized my code
de4c0fb8 Updated the ReadME file
39b41a37 Concluded unit testing
1acecd8c minor
5a1f681e Added a dockerfile, updated the readme and added a requirements.txt file
97c43fa3 remove comm.md
1f20c89f first commit

Full Commit Log View

Console
$ git log

Example Output:

Code
commit e23696290557c029add5490d81bb305dc506f61c
Author: johndoe <johndoe@gmail.com>
Date:   Sun Sep 1 20:03:36 2024 +0100

    removed requirement.txt file

commit 2e39f29b49447219bc32a7fbdd6e8a5834b83911
Author: johndoe <johndoe@gmail.com>
Date:   Sun Sep 1 20:00:50 2024 +0100

    Used Poetry for dependency management

Use arrow keys to scroll and press q to quit the view.

Undoing the Last Commit

You can undo the most recent commit using git reset. Depending on your choice of reset mode, changes can be preserved, unstaged, or discarded.

Command Syntax

Console
git reset [--soft | --mixed | --hard] HEAD~N
  • --soft: Retains staged changes.
  • --mixed: Unstages changes, keeps working directory intact.
  • --hard: Erases all local changes completely.

Examples

Keep staged:

Console
$ git reset --soft HEAD~1

Unstage:

Console
$ git reset --mixed HEAD~1

Discard all changes:

Console
$ git reset --hard HEAD~1

Removing a Specific Commit

If you need to erase a commit that's not the latest, use an interactive rebase to select and delete it manually.

Command Syntax

Console
$ git rebase -i HEAD~N

Example: Editing the Last 8 Commits

Code
pick 5fce205e Enhanced the ReadMe
pick 8404786f minor
pick f5879bb9 minor
pick c26abc6b minor
pick b1db91c2 minor
pick f18e3944 minor
pick ba58ebeb Used Poetry for dependency management
pick 8169d159 removed requirement.txt file

Steps:

  • Press i to enter insert mode.
  • Change pick to drop for the commit you want to remove.
  • Press Esc, type :wq, then press Enter.

Rebase confirmation message:

Successfully rebased and updated refs/heads/main.

Recovering Deleted Commits

If a commit gets lost due to a reset or rebase, you might be able to recover it using Git's reflog, which tracks past HEAD states.

Recovery Commands

  • After hard reset: git reset --hard HEAD@{n}
  • After mixed reset: git reset --mixed HEAD@{n}
  • After soft reset: git reset --soft HEAD@{n}

Viewing Reflog Entries

Console
$ git reflog

Example Output:

Code
7a9a8b2f HEAD@{0}: rebase (finish): returning to refs/heads/main
7a9a8b2f HEAD@{1}: rebase (pick): Used Poetry for dependency management
59c2d68e HEAD@{2}: rebase (start): checkout HEAD~8
8dbe3b9a HEAD@{3}: reset: moving to HEAD~1

View Commit Content Before Recovery

Console
$ git show HEAD@{3}

Reset to Reflog Entry

Console
$ git reset --hard HEAD@{3}

Reset to Specific Commit Hash

Console
$ git reset --hard 8dbe3b9a

Preview the commit:

Console
$ git show 8dbe3b9a

Completely Deleting Files from Git History

To exclude a file or folder from all previous commits, rewriting history is necessary. Simply removing it from current staging doesn’t affect the past.

Remove from Future Commits

Console
$ git rm --cached <path-to-file>
$ git rm -r --cached <path-to-directory>

Erase from Entire History (Recommended)

Console
$ git filter-repo --path <path> --invert-paths

Using git filter-repo for History Rewriting

git filter-repo is the improved alternative to the older git filter-branch command. It offers better performance, reliability, and simplicity for permanently erasing files or folders from Git history. This tool is not bundled with Git by default and must be added separately.

Step-by-Step: Removing Files and Directories with git filter-repo

Install the Tool

Console
$ pip3 install git-filter-repo

Create a Backup of Your Repository

Console
$ cp -r <your-repository-name> <your-repository-name-backup>

Erase a Specific File from Commit History

Console
$ git filter-repo --path <path-to-file> --invert-paths

Confirm the File No Longer Exists in Any Commit

Console
$ git log --all -- <path-to-file>

If there's no output, the removal was successful.

Erase a Directory from Commit History

Console
$ git filter-repo --path <path-to-directory> --invert-paths

Confirm the Directory is Gone from History

Console
$ git log --all -- <path-to-directory>

No output means the directory has been fully purged from the commit history.

Final Thoughts

This tutorial covered several approaches for modifying Git commit history. You learned how to reverse recent commits using git reset, remove particular commits through interactive rebase, and completely wipe files or folders with git filter-repo. Additionally, we looked at how to retrieve deleted commits using git reflog.

Important: When collaborating in shared environments, it's better to use git revert to undo changes without rewriting history. Directly altering commit logs should be reserved for local or non-public branches, as it can cause confusion or conflicts if misused on published branches.

%3Cscript%20type%3D%22application%2Fld%2Bjson%22%3E%0D%0A%7B%0D%0A%20%20%22%40context%22%3A%20%22https%3A%2F%2Fschema.org%22%2C%0D%0A%20%20%22%40type%22%3A%20%22HowTo%22%2C%0D%0A%20%20%22name%22%3A%20%22How%20to%20Remove%20Commits%20from%20Git%20History%20Safely%22%2C%0D%0A%20%20%22description%22%3A%20%22This%20guide%20explains%20how%20to%20view%20Git%20commit%20logs%2C%20undo%20the%20latest%20commit%20with%20git%20reset%2C%20remove%20specific%20commits%20with%20interactive%20rebase%2C%20recover%20deleted%20commits%20with%20git%20reflog%2C%20and%20permanently%20remove%20files%20or%20directories%20from%20Git%20history%20with%20git%20filter-repo.%22%2C%0D%0A%20%20%22inLanguage%22%3A%20%22en-US%22%2C%0D%0A%20%20%22tool%22%3A%20%5B%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Git%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Terminal%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22git%20log%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22git%20reset%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22git%20rebase%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22git%20reflog%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22git%20filter-repo%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTool%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22pip3%22%0D%0A%20%20%20%20%7D%0D%0A%20%20%5D%2C%0D%0A%20%20%22supply%22%3A%20%5B%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSupply%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Git%20repository%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSupply%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Local%20branch%20or%20private%20repository%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSupply%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Repository%20backup%20before%20rewriting%20history%22%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSupply%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Optional%3A%20git-filter-repo%20for%20permanently%20removing%20files%20or%20directories%22%0D%0A%20%20%20%20%7D%0D%0A%20%20%5D%2C%0D%0A%20%20%22step%22%3A%20%5B%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22View%20commits%20in%20Git%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Show%20compact%20commit%20history%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20log%20--oneline%20to%20display%20all%20commits%20in%20a%20compact%20format%20with%20commit%20hash%20and%20commit%20message.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22This%20view%20is%20useful%20for%20quickly%20finding%20the%20commit%20you%20want%20to%20remove%20or%20modify.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Show%20full%20commit%20history%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20log%20to%20display%20commits%20with%20full%20hash%2C%20author%2C%20timestamp%2C%20and%20commit%20message.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Use%20the%20arrow%20keys%20to%20scroll%20through%20the%20output%20and%20press%20q%20to%20quit%20the%20view.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Undo%20the%20latest%20commit%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Undo%20the%20latest%20commit%20and%20keep%20changes%20staged%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20reset%20--soft%20HEAD~1%20to%20remove%20the%20latest%20commit%20while%20keeping%20its%20changes%20staged.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Undo%20the%20latest%20commit%20and%20unstage%20changes%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20reset%20--mixed%20HEAD~1%20to%20remove%20the%20latest%20commit%20and%20keep%20the%20changes%20locally%20while%20removing%20them%20from%20the%20staging%20area.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22git%20reset%20--mixed%20is%20the%20default%20reset%20mode%20when%20no%20option%20is%20specified.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%223%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20the%20latest%20commit%20and%20discard%20all%20changes%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20reset%20--hard%20HEAD~1%20to%20remove%20the%20latest%20commit%20and%20completely%20discard%20the%20related%20local%20changes.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Use%20--hard%20only%20if%20you%20are%20sure%20the%20changes%20are%20no%20longer%20needed.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Remove%20a%20specific%20commit%20from%20history%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%223%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Start%20an%20interactive%20rebase%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20rebase%20-i%20HEAD~N%20and%20replace%20N%20with%20the%20number%20of%20recent%20commits%20you%20want%20to%20edit.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Find%20the%20commit%20to%20remove%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22In%20the%20opened%20commit%20list%2C%20locate%20the%20commit%20you%20want%20to%20remove%20from%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%223%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20the%20commit%20with%20drop%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Replace%20pick%20with%20drop%20for%20the%20commit%20you%20want%20to%20remove.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22In%20Vim%2C%20press%20i%20to%20enter%20insert%20mode%2C%20change%20pick%20to%20drop%2C%20press%20Esc%2C%20then%20save%20and%20quit%20with%20%3Awq.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%224%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Complete%20the%20rebase%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Save%20the%20rebase%20file%20and%20let%20Git%20rewrite%20the%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22A%20successful%20confirmation%20message%20may%20look%20like%3A%20Successfully%20rebased%20and%20updated%20refs%2Fheads%2Fmain.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Recover%20deleted%20commits%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%224%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Show%20the%20reflog%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20reflog%20to%20find%20previous%20HEAD%20positions%20and%20commits%20that%20were%20removed%20or%20moved.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Inspect%20a%20commit%20before%20recovery%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20show%20HEAD%40%7Bn%7D%20to%20inspect%20a%20selected%20reflog%20entry.%20Replace%20n%20with%20the%20correct%20reflog%20number.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%223%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Reset%20to%20a%20reflog%20entry%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20reset%20--hard%20HEAD%40%7Bn%7D%20to%20restore%20your%20repository%20to%20an%20earlier%20reflog%20state.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Depending%20on%20the%20desired%20behavior%2C%20you%20can%20also%20use%20git%20reset%20--soft%20HEAD%40%7Bn%7D%20or%20git%20reset%20--mixed%20HEAD%40%7Bn%7D.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%224%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Reset%20to%20a%20specific%20commit%20ID%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20show%20%3Ccommit-id%3E%20to%20inspect%20the%20commit%2C%20then%20reset%20to%20it%20with%20git%20reset%20--hard%20%3Ccommit-id%3E.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Remove%20files%20from%20future%20commits%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%225%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20a%20file%20from%20Git%20tracking%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20rm%20--cached%20%3Cpath-to-file%3E%20to%20remove%20a%20file%20from%20Git%20tracking%20without%20deleting%20it%20locally.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20a%20directory%20from%20Git%20tracking%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20rm%20-r%20--cached%20%3Cpath-to-directory%3E%20to%20recursively%20remove%20a%20directory%20from%20Git%20tracking.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22These%20commands%20only%20remove%20files%20from%20future%20commits%2C%20not%20from%20the%20existing%20Git%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Permanently%20remove%20files%20or%20directories%20from%20Git%20history%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%226%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Install%20git%20filter-repo%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Install%20git%20filter-repo%20with%20pip3%20install%20git-filter-repo.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22git%20filter-repo%20is%20not%20included%20with%20Git%20by%20default%20and%20is%20often%20used%20as%20a%20better%20replacement%20for%20the%20older%20git%20filter-branch.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Back%20up%20the%20repository%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Create%20a%20backup%20before%20rewriting%20history%20with%20cp%20-r%20%3Cyour-repository-name%3E%20%3Cyour-repository-name-backup%3E.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Rewriting%20Git%20history%20can%20be%20destructive.%20Creating%20a%20backup%20is%20strongly%20recommended.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%223%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20a%20file%20from%20the%20entire%20history%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20filter-repo%20--path%20%3Cpath-to-file%3E%20--invert-paths%20to%20permanently%20remove%20a%20file%20from%20all%20previous%20commits.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%224%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Verify%20file%20removal%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20log%20--all%20--%20%3Cpath-to-file%3E%20to%20check%20whether%20the%20file%20still%20appears%20in%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22If%20there%20is%20no%20output%2C%20the%20file%20has%20been%20successfully%20removed%20from%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%225%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Remove%20a%20directory%20from%20the%20entire%20history%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20filter-repo%20--path%20%3Cpath-to-directory%3E%20--invert-paths%20to%20permanently%20remove%20a%20directory%20from%20Git%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%226%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Verify%20directory%20removal%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Run%20git%20log%20--all%20--%20%3Cpath-to-directory%3E%20to%20check%20whether%20the%20directory%20still%20exists%20in%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22No%20output%20means%20the%20directory%20has%20been%20successfully%20removed%20from%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22%40type%22%3A%20%22HowToSection%22%2C%0D%0A%20%20%20%20%20%20%22name%22%3A%20%22Work%20safely%20in%20shared%20repositories%22%2C%0D%0A%20%20%20%20%20%20%22position%22%3A%20%227%22%2C%0D%0A%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Avoid%20rewriting%20shared%20branch%20history%20carelessly%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Use%20git%20reset%2C%20git%20rebase%2C%20and%20git%20filter-repo%20mainly%20on%20local%20or%20private%20branches%20to%20avoid%20conflicts%20with%20other%20developers.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToStep%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Prefer%20git%20revert%20in%20shared%20repositories%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%22itemListElement%22%3A%20%5B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToDirection%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%221%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22Use%20git%20revert%20in%20shared%20repositories%20to%20undo%20changes%20without%20rewriting%20existing%20history.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HowToTip%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22position%22%3A%20%222%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22text%22%3A%20%22git%20revert%20creates%20a%20new%20commit%20that%20reverses%20the%20changes%20of%20an%20earlier%20commit%2C%20making%20it%20safer%20for%20team%20workflows.%22%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%5D%0D%0A%20%20%20%20%7D%0D%0A%20%20%5D%0D%0A%7D%0D%0A%3C%2Fscript%3E

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren