this will delete your local version!!
go back to commit x (=c5f567)
git checkout c5f567 -- file/1/to/restore file/2/to/restore
go back to commit x-1
git checkout c5f567~1 -- file/1/to/restore file/2/to/restore
note the --
indicating a destructive overwrite of the working copy
maybe update your branches first: `git fetch
-
git remote prune
prunes local tracking branches which have no remote counterpart. -
git branch --merged
list all branches that have been merged into the current branch -
now pick all except master/develop and do this for all of them:
git branch -d <branch>
deletes a branch
alternative: git fetch -p
might be better since it also updates all the references. then you can git branch -vv
and all branches which have ": gone" besides them can safely be deleted.
add to ~/.gitconfig
[alias]
adog = log --all --decorate --oneline --graph
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'