Skip to content

Instantly share code, notes, and snippets.

@stevenyap
stevenyap / Git Reset-Revert.md
Created November 17, 2013 09:50
Git reset and revert: Undoing changs

Difference between reset and revert

  • Reset rewinds history (files + commits) back to the previous commits
  • Revert rewinds your files back to the previous commits by adding a new commit to show this
  • You should use revert (especially if you have pushed) as it does not rewrite history

Git Reset

# If you are pulling, rebasing or your new code is a mess, and you want to return to the last committed point:
@lkraider
lkraider / adf2mp3.py
Created November 2, 2011 22:40
GTA Vice City ADF to MP3 audio converter
#!/usr/bin/env python
import sys
import os
def adf2mp3(input_path, output_path, buffer_size=1024*1024):
print 'Converting', output_path
input_file = open(input_path, 'rb')
output_file = open(output_path, 'wb')
for read_buffer in iter(lambda: input_file.read(buffer_size), ''):