• Stars
    star
    197
  • Rank 197,238 (Top 4 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

It's like undelete for your git repository.

git-recover: recover deleted files in your repository

CI

git-recover allows you to recover some files that you've accidentally deleted from your working directory. It helps you find files that exist in the repository's object database - because you ran git add - but were never committed.

Getting Started

The simplest way to use git-recover is in interactive mode - simply run git-recover -i and it will show you all the files that you can recover and prompt you to act.

Using git-recover

Running git-recover without any arguments will list all the files (git "blobs") that were recently orphaned, by their ID. (Their filename is not known.)

You can examine these blobs by running git show <objectid>. If you find one that you want to recover, you can provide the ID as the argument to git-recover. You can specify the --filename option to write the file out and apply any filters that are set up in the repository. For example:

git-recover 38762cf7f55934b34d179ae6a4c80cadccbb7f0a --filename shattered.pdf

You can also specify multiple files to recover, each with an optional output filename:

git-recover 38762c --filename one.txt cafebae --filename bae.txt

If you want to recover all the orphaned blobs in your repository, run git-recover --all. This will write all the orphaned files to the current working directory, so it's best to run this inside a temporary directory beneath your working directory. For example:

mkdir _tmp && cd _tmp && git-recover --all

By default, git-recover limits itself to recently created orphaned blobs. If you want to see all orphaned files that have been created in your repository (but haven't yet been garbage collected), you can run:

git-recover --full

Options

git-recover [-a] [-i] [--full] [<id> [-f <filename>] ...]

-a, --all
Write all orphaned blobs to the current working directory. Each file will be named using its 40 character object ID.

-i, --interactive
Display information about each orphaned blob and prompt to recover it.

--full
List or recover all orphaned blobs, even those that are in packfiles. By default, git-recover will only look at loose object files, which limits it to the most recently created files. Examining packfiles may be slow, especially in large repositories.

<id>
The object ID (or its abbreviation) to recover. The file will be written to the current working directory and named using its 40 character object ID, unless the -f option is specified.

-f <filename>, --filename <filename>
When specified after an object ID, the file written will use this filename. In addition, any filters (for example: CRLF conversion or Git-LFS) will be run according to the gitattributes configuration.

Getting Help and Contributing

To report bugs, get assistance or provide a bug fix to this program, check it out on GitHub.

Copyright (c) Edward Thomson. All rights reserved.

git-recover is open source software and is available under the MIT license. Please see the included LICENSE file for more information.

More Repositories

1

jagged

java bindings to libgit2
Java
108
star
2

github4life

Using your GitHub Contribution Graph as a four-color Game of Life.
JavaScript
92
star
3

send-tweet-action

Send a tweet from a GitHub Action
TypeScript
84
star
4

next-maze

A maze creation and solution API
TypeScript
60
star
5

issue-dashboard

A customizable dashboard for GitHub issues and pull requests, using GitHub Pages and GitHub Actions
TypeScript
51
star
6

retarget_prs

A project to batch update the base of PRs
JavaScript
30
star
7

git-dad

Enjoy your typos
Shell
24
star
8

adopt

A portable command-line argument parser
C
17
star
9

ethomson

15
star
10

probot-serverless-azurefunctions

Azure Functions adapter for Probot tools
JavaScript
15
star
11

gitpowershell

Git PowerShell module
C#
12
star
12

summoner

A simple Windows application to notify you of mentions in chat rooms like Campfire or TFS Team Rooms
C#
9
star
13

contributions

Library for GitHub Contribution graphs
TypeScript
7
star
14

probot-azure-pipelines

A GitHub app for Azure Pipelines, powered by Probot
TypeScript
7
star
15

poxyproxy

A simple HTTP proxy
Java
7
star
16

ntlmclient

A POSIX implementation of NTLM2 client authentication. ๐Ÿ˜ญ
C
5
star
17

cloud-scanner

Cloud Scanner is a cloud agnostic tool that extracts cloud based resources from cloud providers like Azure and ingests them into a configured data source for further processing.
Python
5
star
18

PurgeStandbyList

Purge the Windows "standby list" (caches)
C
4
star
19

rust-build-container

PowerShell
4
star
20

hexdump

Simple hexdump utility for win32 with outputs similar to BSD hexdump.
C#
4
star
21

rko

Another JavaScript web framework
3
star
22

setup-gitversion

Install the gitversion semantic versioning utility
JavaScript
3
star
23

mona-action

A GitHub Action to brighten your mood
JavaScript
3
star
24

bad-line-endings

3
star
25

dat-life

dat conway life
TypeScript
3
star
26

edge-wasm-examples

Makefile
3
star
27

radar

A LibGit2Sharp based Git repositories network monitoring tool
C#
3
star
28

vscode_dmg

Shell
2
star
29

libgit2-docker

Dockerfile
2
star
30

merge_vs_rebase

2
star
31

www.hasborisjohnsonresigned.com

Has he?
JavaScript
2
star
32

actions.sh

bash helpers for GitHub Actions
Shell
2
star
33

calculator.old

You're the operator with your pocket calculator
JavaScript
2
star
34

cloud64

Commodore 64 in the โ˜๏ธ
C#
2
star
35

matrixtest

2
star
36

actions-test2

2
star
37

calculator

You're the operator with your pocket calculator
JavaScript
2
star
38

test

JavaScript
2
star
39

next-wasm

TypeScript
2
star
40

hexdump.core

Simple hexdump utility for win32 with outputs similar to BSD hexdump.
C#
2
star
41

reservednames

1
star
42

secrets

1
star
43

helloworld-aspnetcore

Hello, World in ASP.NET Core
C#
1
star
44

testA

1
star
45

imagedemo

HTML
1
star
46

whereami

TypeScript
1
star
47

containeraction

Shell
1
star
48

GoogleAnalyticsHandler

An ASP handler for reporting request data to Google Analytics
C#
1
star
49

ersatz

Not much of a gem at all
Ruby
1
star
50

dogged.www

WWW site for the Dogged project
HTML
1
star
51

github-satellite-hands-on-labs

1
star
52

swt_plotcontrol

SWT plotting control
Java
1
star
53

DisplayAspRequest

Display the details of an ASP.net request
C#
1
star
54

node-helloworld

Hello, world in node.js
JavaScript
1
star
55

calculator.dependabot

You're the operator with your pocket calculator
JavaScript
1
star
56

crlf

1
star
57

swift-ios

A Swift (iOS) project for Azure Pipelines
Swift
1
star
58

escalator-action

Run a repository dispatch workflow from a different GitHub Actions workflow
TypeScript
1
star
59

Blackjack

C++
1
star
60

actions-test3

1
star
61

create-project-action

Create a GitHub Project
TypeScript
1
star
62

rust-build-packer

PowerShell
1
star
63

frak

HTML
1
star
64

poxygit

A testing git server
Java
1
star
65

nothing

There's literally nothing here
1
star
66

card

Ha ha! Business!
JavaScript
1
star
67

node

A node.js project for Azure Pipelines
JavaScript
1
star
68

docurium-action

Run Docurium on a project
Dockerfile
1
star
69

good-line-endings

1
star
70

lf

1
star
71

lineEndings

1
star
72

probot-azure-pipelines-serverless

Probot for Azure Pipelines (in Azure Functions)
JavaScript
1
star
73

IndexBrowser

A Git index browser
C#
1
star
74

env-action

TypeScript
1
star
75

next-with-storybook

JavaScript
1
star
76

azure-pipelines-kubernetes-agent

Azure Pipeliness agent container for Kubernetes operation
PowerShell
1
star
77

untitled-github-game

It's a lovely morning at GitHub, and you are a horrible goose.
1
star
78

gitresources

Git resources list for Windows
JavaScript
1
star
79

env-nextapp

TypeScript
1
star
80

tokentest

1
star
81

test01

1
star
82

test-action

1
star
83

cve-2022-41032

Reproduction / example repository for CVE 2022-41032.
C#
1
star