Skip to content

Instantly share code, notes, and snippets.

@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 26, 2025 13:45
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@JacobLett
JacobLett / gist:914c7b6a893def32ed8dfc8769254c95
Created September 27, 2016 13:16
defer after jquery loaded - jquery code before jquery is loaded
<script>
if ( ! window.deferAfterjQueryLoaded ) {
window.deferAfterjQueryLoaded = [];
Object.defineProperty(window, "$", {
set: function(value) {
window.setTimeout(function() {
$.each(window.deferAfterjQueryLoaded, function(index, fn) {
fn();
});
}, 0);
@ssalonen
ssalonen / OpenWrt SSH tunnel.md
Last active May 20, 2025 18:19
OpenWrt SSH tunnel

Short how-to for creating a reverse ssh tunnel to a remote server. Useful for breaking NATted connection for example.

  1. At OpenWrt:
opkg update
opkg install sshtunnel
  1. At remote server: create client ssh keys
@davidbradway
davidbradway / setup.md
Last active May 19, 2020 22:00
Set Up Docker On Raspberry Pi Raspbian Stretch Lite
@sdhzdmzzl
sdhzdmzzl / bj-unicom-iptv.m3u
Last active June 2, 2025 21:33
北京联通iptv列表
#EXTINF:-1,CCTV-1
rtp://239.3.1.1:8000
#EXTINF:-1,CCTV-2
rtp://239.3.1.2:8004
#EXTINF:-1,CCTV-4
rtp://239.3.1.4:8216
#EXTINF:-1,CCTV-7