Skip to content

Instantly share code, notes, and snippets.

Accidentally pushed sensitive data? Follow these steps to undo the damage.
If you have accidentally pushed some sensitive information to a remote repository, you don’t need to panic. Take couple of deep breaths; Wipe the sweat off your forehead; And follow the steps below.
First, control the damage:
Any sensitive information pushed to a public repository should be considered compromised. So if there are passwords and private keys in those commits, change them right now!
Scenario 1: You pushed sensitive information in your last commit.
If the sensitive information was in the last commit you just pushed to remote, you can amend it right away. Here we use the master branch as an example but you could do this on any branch.
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,