Skip to content
A tool that helps you to restore commits erased by a force push
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

TIFU (Today I Fucked Up)


TIFU is a tool that helps to restore commits erased by a force push on Github, Gitlab and Bitbucket.


Python 3.5+


Just clone, install dependencies, and you're ready to go!

git clone
cd tifu
pip3 install -r requirements.txt --user
./ --help

How to use it?

The simplest way to run the tool is to launch it with a remote as argument:




It will automatically infer the API, repository name and hostname to use.

If you want to run it on your own instance of Gitlab for example, this will fail since the tool can't determine which API to use. Just specify it:

./ --api gitlab

This is equivalent to the following command:

./ --api gitlab --host --repo namespace/project

You can also just connect to a specific API and select the repository interactively:

./ --api bitbucket

Which works for your own instances as well:

./ --api github --host


usage: [-h] [-a] [--host HOST] [-n REPO] [remote]

positional arguments:
  remote                git remote

optional arguments:
  -h, --help            show this help message and exit
  -a , --api            API to use (github, gitlab, bitbucket)
  --host HOST           server hostname
  -r REPO, --repo REPO  repository name (namespace/project)

How does it work?

Git repository managers are usually using event systems to build users' threads. These events are accessible via APIs and are providing various pieces of information.

In this case, we are using events generated on push to get the ID of the previous HEAD and create a branch pointing to it.

Old HEAD's objects are usually still available since they are not removed until the repository is garbage collected on the server side.

You can’t perform that action at this time.