Skip to main content

How to hard reset a GitHub commit

  • Get commit ID using this command
git log

  • Revert using the specif id
git revert 497011c4a1914839a6555dc8041ac89b5d1f3241

  • Reset master branch to the parent of reverted commit id
git push origin +497011c4a1914839a6555dc8041ac89b5d1f3241^:master


           (git interprets x^ as the parent of x and + as a forced non-fast forward push.)

Comments

Popular posts from this blog

Solving PyCharm bug: "Python helpers are not copied yet..."

I have been using PyCharm Professional to run and debug Python code from my Windows machine to a remote Linux device. There are some other tools available for the same purpose (e.g. Python Tool for Visual Studio 2017). But in my opinion, PyCharm Professional stands out among its counterparts as it comes with a "All Batteries Included" setup. Once you configure remote Python interpreter in PyCharm, then it works out of the box. However, today after upgrading to PyCharm Professional 2018.2.1, I could not run my Python script on remote device. The execution always failed with below error - "Error running 'hello': Python helpers are not copied yet to the remote host. Please wait until remote interpreter initialization finishes." To solve this issue, I had to remove the ".pycharm_helpers " folder from the remove device and then restart PyCharm so that the folder is re-created and files are copied again. Here are the steps with comma...

Customized Crosshair with OxyPlot charting library

I am using Oxyplot to draw heatmap for a WPF project and needed to draw a crosshair that moves according to user clicks. Since I couldn't find any good example or documentation on the topic, I made a small hack by using LineAnnotations and by over-riding Oxyplot mouse click event. Here is the sample code using WPF with MVVM pattern- MainWindow.xaml <Grid>         <oxy:Plot x:Name="CrossHairPlot">             <oxy:Plot.Axes>                 <oxy:LinearAxis Key="MyXAxis" Position="Bottom" IsZoomEnabled="False"/>                 <oxy:LinearAxis Key="MyYAxis" Position="Left" IsZoomEnabled="False"/>                 <oxy:LinearColorAxis Key="...

Profiling with SQL Server Management Studio

On the Query menu, click on ‘Include Advance Execution Plan’ or click the toolbar button. Now open a new query window, type the following queries and execute them. use Northwind ; set statistics io on ; set statistics time on ;  Select top 5 * from Customers   You should be now able to see additional information in the message tab and execution plan tab (along with result tab in lower window pane)