Skip to content

Instantly share code, notes, and snippets.

View zfael's full-sized avatar

Rafael Bertelli zfael

View GitHub Profile
@zfael
zfael / .bash_profile - NVM for windows
Last active October 23, 2018 12:59 — forked from allenhwkim/.bash_profile
usage of .nvmrc
# To use this, add .nvmrc with contents of 'N.N.N' to your project. e.g. 0.12.7
# Add the following to the end of .bash_profile or .bashrc
#
# if directory is changed
# if `.nvmrc` is found execute `nvm use`
# if `package.json` is round execute `nvm use default`
enter_directory() {
if [ "$PWD" != "$PREV_PWD" ]; then
PREV_PWD="$PWD";
if [ -e ".nvmrc" ]; then
@zfael
zfael / git-restore-file.sh
Created July 12, 2018 11:57 — forked from infusion/git-restore-file.sh
Find and restore a deleted file in a Git
# Find last commit for the deleted file
git rev-list -n 1 HEAD -- $path
# Checkout the commit before the the delete happened
git checkout $commit^ -- $path
@zfael
zfael / uncommitLastCommit.md
Created April 19, 2018 17:45 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say